Handle nullish, not falsey values in numeric input

This commit is contained in:
Maciej Ziarkowski 2019-11-22 16:03:36 +00:00
parent 2ffa14cdbb
commit 866e103a80

View File

@ -27,10 +27,10 @@ const NumericDataEntry: React.FunctionComponent<NumericDataEntryProps> = (props)
type="number"
id={props.slug}
name={props.slug}
value={props.value || ''}
step={props.step || 1}
value={props.value == undefined ? '' : props.value}
step={props.step == undefined ? 1 : props.step}
max={props.max}
min={props.min || 0}
min={props.min}
disabled={props.mode === 'view' || props.disabled}
placeholder={props.placeholder}
onChange={e =>