From 4d6aa8aa2550e227d37bc3cefa760a1db624288f Mon Sep 17 00:00:00 2001 From: Isaac Way Date: Thu, 22 Dec 2022 09:03:15 -0600 Subject: [PATCH] fixes bug stopping form submission after resetting form (x button) --- .../components/form/ProcedureForm/index.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/trpc-panel/src/react-app/components/form/ProcedureForm/index.tsx b/packages/trpc-panel/src/react-app/components/form/ProcedureForm/index.tsx index 4c158c0..59a9bae 100644 --- a/packages/trpc-panel/src/react-app/components/form/ProcedureForm/index.tsx +++ b/packages/trpc-panel/src/react-app/components/form/ProcedureForm/index.tsx @@ -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]);