fix(striker-ui): use variable id when getting field value in GateForm

main
Tsu-ba-me 12 months ago
parent 1b923be6a2
commit 2544794c5d
  1. 15
      striker-ui/components/GateForm.tsx

@ -75,7 +75,7 @@ const GateForm = forwardRef<GateFormForwardedRefContent, GateFormProps>(
const [isSubmitting, setIsSubmitting] = useState<boolean>(false); const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
const formUtils = useFormUtils( const formUtils = useFormUtils(
[INPUT_ID_GATE_ID, INPUT_ID_GATE_PASSPHRASE], [identifierId, passphraseId],
messageGroupRef, messageGroupRef,
); );
const { const {
@ -101,10 +101,10 @@ const GateForm = forwardRef<GateFormForwardedRefContent, GateFormProps>(
const { elements } = target as HTMLFormElement; const { elements } = target as HTMLFormElement;
const { value: identifierValue } = elements.namedItem( const { value: identifierValue } = elements.namedItem(
INPUT_ID_GATE_ID, identifierId,
) as HTMLInputElement; ) as HTMLInputElement;
const { value: passphraseValue } = elements.namedItem( const { value: passphraseValue } = elements.namedItem(
INPUT_ID_GATE_PASSPHRASE, passphraseId,
) as HTMLInputElement; ) as HTMLInputElement;
onSubmitAppend?.call( onSubmitAppend?.call(
@ -118,7 +118,14 @@ const GateForm = forwardRef<GateFormForwardedRefContent, GateFormProps>(
...args, ...args,
); );
}), }),
[onSubmit, onSubmitAppend, setIsSubmitting, setMessage], [
identifierId,
onSubmit,
onSubmitAppend,
passphraseId,
setIsSubmitting,
setMessage,
],
); );
const submitElement = useMemo( const submitElement = useMemo(

Loading…
Cancel
Save