Skip to content

Commit

Permalink
Merge pull request #23 from iway1/bugfix/form-reset
Browse files Browse the repository at this point in the history
fixes bug stopping form submission after resetting form (x button)
  • Loading branch information
iway1 authored Dec 22, 2022
2 parents 3a8e290 + 4d6aa8a commit d92f7bc
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,14 @@ export function ProcedureForm({
const [shouldReset, setShouldReset] = useState(false);
useEffect(() => {
if (shouldReset) {
resetForm(defaultFormValuesForNode(procedure.node), {
keepValues: false,
keepDirtyValues: false,
keepDefaultValues: false,
});
resetForm(
{ [ROOT_VALS_PROPERTY_NAME]: defaultFormValuesForNode(procedure.node) },
{
keepValues: false,
keepDirtyValues: false,
keepDefaultValues: false,
}
);
setShouldReset(false);
}
}, [shouldReset]);
Expand Down

0 comments on commit d92f7bc

Please sign in to comment.