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:
schroda
2024-11-09 20:42:29 +01:00
parent f88dda32a0
commit 4b86428dc7

View File

@@ -170,7 +170,10 @@ export const NumberSetting = ({
type="number"
onChange={(e) => {
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={{
input: {