Skip to content
Snippets Groups Projects
Commit d00aabfb authored by Leonardo Christino's avatar Leonardo Christino
Browse files

fix: min and max depth may be equal

parent 721b1f54
No related branches found
Tags v1.28.0
No related merge requests found
Pipeline #128449 passed
......@@ -23,7 +23,7 @@ export const QuerySettingsDialog = React.forwardRef<HTMLDivElement, QuerySetting
dispatch(addWarning('The minimum depth cannot be smaller than 0'));
} else if (state.depth.max > 99) {
dispatch(addWarning('The maximum depth cannot be larger than 99'));
} else if (state.depth.min >= state.depth.max) {
} else if (state.depth.min > state.depth.max) {
dispatch(addWarning('The minimum depth cannot be larger than the maximum depth'));
} else {
dispatch(setQuerybuilderSettings(state));
......@@ -67,7 +67,7 @@ export const QuerySettingsDialog = React.forwardRef<HTMLDivElement, QuerySetting
className="input input-sm input-bordered w-full"
placeholder="0"
min={0}
max={state.depth.max - 1}
max={state.depth.max}
value={state.depth.min}
onChange={(e) => setState({ ...state, depth: { min: parseInt(e.target.value), max: state.depth.max } })}
onKeyDown={(e) => {
......@@ -85,7 +85,7 @@ export const QuerySettingsDialog = React.forwardRef<HTMLDivElement, QuerySetting
type="number"
className="input input-sm input-bordered w-full"
placeholder="0"
min={state.depth.min + 1}
min={state.depth.min}
max={99}
value={state.depth.max}
onChange={(e) => setState({ ...state, depth: { max: parseInt(e.target.value), min: state.depth.min } })}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment