Prevent invalid values for "auto scroll speed"
The min/max limit was only acknowledged when the value was changed via MUIs step logic. In case the number got inputted via keystrokes the limits did not get applied
This commit is contained in:
@@ -37,3 +37,5 @@ export const getValueFromObject = <T>(obj: Record<string, any>, key: string): T
|
||||
|
||||
return keys.reduce((acc, curr) => acc?.[curr], obj) as T;
|
||||
};
|
||||
|
||||
export const coerceIn = (value: number, min: number, max: number): number => Math.min(Math.max(value, min), max);
|
||||
|
||||
Reference in New Issue
Block a user