mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 03:23:48 +01:00
fix min and max props
This commit is contained in:
parent
11222aaa82
commit
53e961b9bb
@ -58,8 +58,8 @@ const _NumberField = ({ name, min, max, muiTheme, ...props }, context) => (
|
||||
value={_.get(context, name.toString())}
|
||||
onChange={(event, value) => {
|
||||
value = parseFloat(value);
|
||||
if (min) value = Math.max(value, min);
|
||||
if (max) value = Math.min(value, max);
|
||||
if (typeof min === 'number') value = Math.max(value, min);
|
||||
if (typeof max === 'number') value = Math.min(value, max);
|
||||
context.onChange(name, value);
|
||||
}}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user