From c8eaae792852388a7f126db06cd5c11075a61026 Mon Sep 17 00:00:00 2001 From: Chuma McPhoy Date: Mon, 25 Nov 2024 11:15:59 +0100 Subject: [PATCH] fix(SW-360): change button to signup to trigger shouldFocusError --- components/Forms/Signup/index.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/components/Forms/Signup/index.tsx b/components/Forms/Signup/index.tsx index a8d05d335..11f59c2aa 100644 --- a/components/Forms/Signup/index.tsx +++ b/components/Forms/Signup/index.tsx @@ -79,17 +79,6 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) { signup.mutate({ ...data, language: lang }) } - async function handleValidation() { - const result = await methods.trigger() - if (!result) { - // Get first error field and focus on it. - const firstError = Object.keys(methods.formState.errors)[0] - if (firstError) { - methods.setFocus(firstError as keyof SignUpSchema) - } - } - } - return (
{title} @@ -198,10 +187,10 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) { {!methods.formState.isValid ? (