From b8d159b54d42a087c90ef831fc14a00127fc5100 Mon Sep 17 00:00:00 2001 From: Tony Vi Date: Mon, 23 Jan 2023 20:01:00 +0300 Subject: [PATCH] chore: disable errors focus in modal forms --- src/components/GoalForm.tsx | 6 +++--- src/components/ProjectCreateForm.tsx | 2 +- src/components/TeamCreateForm.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/GoalForm.tsx b/src/components/GoalForm.tsx index c9663322c..2b94ae579 100644 --- a/src/components/GoalForm.tsx +++ b/src/components/GoalForm.tsx @@ -66,8 +66,8 @@ const schemaProvider = (t: (key: string) => string) => kind: z.string(), }, { - invalid_type_error: "Goal's project or team are required", - required_error: "Goal's project or team are required", + invalid_type_error: t("Goal's project or team are required"), + required_error: t("Goal's project or team are required"), }, ), state: z.object({ @@ -158,7 +158,7 @@ export const GoalForm: React.FC = ({ resolver: zodResolver(schema), mode: 'onChange', reValidateMode: 'onChange', - shouldFocusError: true, + shouldFocusError: false, defaultValues: { title, description, diff --git a/src/components/ProjectCreateForm.tsx b/src/components/ProjectCreateForm.tsx index 02bfd751c..90f495812 100644 --- a/src/components/ProjectCreateForm.tsx +++ b/src/components/ProjectCreateForm.tsx @@ -100,7 +100,7 @@ const ProjectCreateForm: React.FC = () => { resolver: zodResolver(schema), mode: 'onChange', reValidateMode: 'onChange', - shouldFocusError: true, + shouldFocusError: false, }); useEffect(() => { diff --git a/src/components/TeamCreateForm.tsx b/src/components/TeamCreateForm.tsx index 99a384a00..db6c4857f 100644 --- a/src/components/TeamCreateForm.tsx +++ b/src/components/TeamCreateForm.tsx @@ -124,7 +124,7 @@ const TeamCreateForm: React.FC = () => { resolver: zodResolver(schema), mode: 'onChange', reValidateMode: 'onChange', - shouldFocusError: true, + shouldFocusError: false, }); useEffect(() => {