next csv params

This commit is contained in:
Jan Prochazka
2020-11-19 11:36:34 +01:00
parent 0cd3e393e8
commit 7ccb1d9c90
5 changed files with 21 additions and 6 deletions

View File

@@ -50,12 +50,14 @@ export function FormTextField({ label, ...other }) {
);
}
export function FormCheckboxFieldRaw({ name = undefined, ...other }) {
export function FormCheckboxFieldRaw({ name = undefined, defaultValue = undefined, ...other }) {
const { values, setFieldValue } = useFormikContext();
const handleChange = (event) => {
setFieldValue(name, event.target.checked);
};
return <CheckboxField name={name} checked={!!values[name]} onChange={handleChange} {...other} />;
let isChecked = values[name];
if (isChecked == null) isChecked = defaultValue;
return <CheckboxField name={name} checked={!!isChecked} onChange={handleChange} {...other} />;
// return <Field {...other} as={CheckboxField} />;
}