mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 11:33:49 +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())}
|
value={_.get(context, name.toString())}
|
||||||
onChange={(event, value) => {
|
onChange={(event, value) => {
|
||||||
value = parseFloat(value);
|
value = parseFloat(value);
|
||||||
if (min) value = Math.max(value, min);
|
if (typeof min === 'number') value = Math.max(value, min);
|
||||||
if (max) value = Math.min(value, max);
|
if (typeof max === 'number') value = Math.min(value, max);
|
||||||
context.onChange(name, value);
|
context.onChange(name, value);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user