From 2fb4cfacb1ecbc82146f16417379e55252bba887 Mon Sep 17 00:00:00 2001 From: Kevin Tun Date: Tue, 22 Aug 2023 18:17:40 -0500 Subject: [PATCH] chore: remove shouldFocusError option from useForm hook The shouldFocusError option is removed from the useForm hook in both PaymentPage.tsx and ShippingPage.tsx components. This option was unnecessary and not being used, so it was removed to simplify the code and improve readability. --- apps/stock-center/src/components/PaymentPage.tsx | 1 + packages/ui-dsc/src/order/ShippingPage.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/stock-center/src/components/PaymentPage.tsx b/apps/stock-center/src/components/PaymentPage.tsx index 6bdceda090..531e4155d5 100644 --- a/apps/stock-center/src/components/PaymentPage.tsx +++ b/apps/stock-center/src/components/PaymentPage.tsx @@ -43,6 +43,7 @@ const PaymentPage = () => { mode: "onTouched", resolver: yupResolver(validationSchema), defaultValues: paymentFormData, + shouldFocusError: false, }) const { handleSubmit } = methods const onSubmit = (data: PaymentFormData) => { diff --git a/packages/ui-dsc/src/order/ShippingPage.tsx b/packages/ui-dsc/src/order/ShippingPage.tsx index 2fabfd9529..83a2f0e6e3 100644 --- a/packages/ui-dsc/src/order/ShippingPage.tsx +++ b/packages/ui-dsc/src/order/ShippingPage.tsx @@ -42,6 +42,7 @@ const ShippingPage = ({ setFormData, nextStep }: ShippingPageProperties) => { const methods = useForm({ mode: "onTouched", resolver: yupResolver(validationSchema), + shouldFocusError: false, }) const { handleSubmit } = methods