From 126cc5a23e1bac62a4f5ceff4f8d7cb4d3e47fd8 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 4 Nov 2025 08:22:50 -0600 Subject: [PATCH] only validate id field when name field has no errors --- web/src/components/input/NameAndIdFields.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/web/src/components/input/NameAndIdFields.tsx b/web/src/components/input/NameAndIdFields.tsx index f4d004cc4..eec2998a2 100644 --- a/web/src/components/input/NameAndIdFields.tsx +++ b/web/src/components/input/NameAndIdFields.tsx @@ -64,12 +64,25 @@ export default function NameAndIdFields({ const subscription = watch((value, { name }) => { if (name === nameField) { const processedId = effectiveProcessId(value[nameField] || ""); - setValue(idField, processedId as PathValue>); - trigger(idField); + setValue(idField, processedId as PathValue>, { + shouldValidate: false, + }); + // Only trigger validation if nameField has no errors + if (!errors[nameField]) { + trigger(idField); + } } }); return () => subscription.unsubscribe(); - }, [watch, setValue, trigger, nameField, idField, effectiveProcessId]); + }, [ + watch, + setValue, + trigger, + nameField, + idField, + effectiveProcessId, + errors, + ]); const idError = errors[idField]; useEffect(() => {