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:
@ -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"
|
||||
/>
|
||||
}
|
||||
|
Reference in New Issue
Block a user