fix issue with number inputs not serializing correctly due to setting values as strings instead of numbers (#94)

consolidate number, string and checkbox value change functions

(cherry picked from commit 22c1590885db0534afabff74be7504ca9a0998b5)
This commit is contained in:
rjwats
2020-02-27 00:05:38 +00:00
committed by GitHub
parent a042633d8f
commit fb7053610f
6 changed files with 20 additions and 18 deletions

View File

@ -28,14 +28,14 @@ class NTPSettingsForm extends React.Component<NTPSettingsFormProps> {
}
render() {
const { data, handleValueChange, handleCheckboxChange, saveData, loadData } = this.props;
const { data, handleValueChange, saveData, loadData } = this.props;
return (
<ValidatorForm onSubmit={saveData}>
<BlockFormControlLabel
control={
<Checkbox
checked={data.enabled}
onChange={handleCheckboxChange('enabled')}
onChange={handleValueChange('enabled')}
value="enabled"
/>
}