cast number as string

This commit is contained in:
casperlamboo 2018-01-17 12:00:19 +01:00
parent 137f95fdba
commit 89e67882a0

View File

@ -52,7 +52,7 @@ export const NumberField = (props, context) => (
icon={context.advancedFields.includes(props.name) && <RefreshIcon onTouchTap={() => context.onChange(props.name, null)} />} icon={context.advancedFields.includes(props.name) && <RefreshIcon onTouchTap={() => context.onChange(props.name, null)} />}
floatingLabelStyle={{ color: context.advancedFields.includes(props.name) ? blue500 : grey500 }} floatingLabelStyle={{ color: context.advancedFields.includes(props.name) ? blue500 : grey500 }}
disabled={context.disabled} disabled={context.disabled}
value={_.get(context, props.name)} value={_.get(context, props.name.toString())}
onChange={(event, value) => { onChange={(event, value) => {
value = parseFloat(value); value = parseFloat(value);
if (props.min) value = Math.max(value, props.min); if (props.min) value = Math.max(value, props.min);