From 2544794c5d3a8558011f68151e16179eb37458f2 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 4 Jan 2024 15:03:13 -0500 Subject: [PATCH] fix(striker-ui): use variable id when getting field value in GateForm --- striker-ui/components/GateForm.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/striker-ui/components/GateForm.tsx b/striker-ui/components/GateForm.tsx index 67c72172..44840186 100644 --- a/striker-ui/components/GateForm.tsx +++ b/striker-ui/components/GateForm.tsx @@ -75,7 +75,7 @@ const GateForm = forwardRef( const [isSubmitting, setIsSubmitting] = useState(false); const formUtils = useFormUtils( - [INPUT_ID_GATE_ID, INPUT_ID_GATE_PASSPHRASE], + [identifierId, passphraseId], messageGroupRef, ); const { @@ -101,10 +101,10 @@ const GateForm = forwardRef( const { elements } = target as HTMLFormElement; const { value: identifierValue } = elements.namedItem( - INPUT_ID_GATE_ID, + identifierId, ) as HTMLInputElement; const { value: passphraseValue } = elements.namedItem( - INPUT_ID_GATE_PASSPHRASE, + passphraseId, ) as HTMLInputElement; onSubmitAppend?.call( @@ -118,7 +118,14 @@ const GateForm = forwardRef( ...args, ); }), - [onSubmit, onSubmitAppend, setIsSubmitting, setMessage], + [ + identifierId, + onSubmit, + onSubmitAppend, + passphraseId, + setIsSubmitting, + setMessage, + ], ); const submitElement = useMemo(