Skip to content

Commit

Permalink
fixes bug stopping form submission after resetting form (x button)
Browse files Browse the repository at this point in the history
  • Loading branch information
iway1 committed Dec 22, 2022
1 parent 3a8e290 commit 4d6aa8a
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 4d6aa8a

Please sign in to comment.