Limit max and min values of number setting textfield
Limits were passed through to the slider but were not applied to the text field
This commit is contained in:
@@ -170,7 +170,10 @@ export const NumberSetting = ({
|
|||||||
type="number"
|
type="number"
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const newValue = Number(e.target.value);
|
const newValue = Number(e.target.value);
|
||||||
updateValue(newValue, false);
|
const newValueMinLimit = Math.min(newValue, maxValue ?? newValue);
|
||||||
|
const newValueMaxLimit = Math.max(newValueMinLimit, minValue ?? newValueMinLimit);
|
||||||
|
|
||||||
|
updateValue(newValueMaxLimit, false);
|
||||||
}}
|
}}
|
||||||
slotProps={{
|
slotProps={{
|
||||||
input: {
|
input: {
|
||||||
|
|||||||
Reference in New Issue
Block a user