Skip to content

Commit

Permalink
chore: disable errors focus in modal forms
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Jan 23, 2023
1 parent 607b6a8 commit b8d159b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/GoalForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -158,7 +158,7 @@ export const GoalForm: React.FC<GoalFormProps> = ({
resolver: zodResolver(schema),
mode: 'onChange',
reValidateMode: 'onChange',
shouldFocusError: true,
shouldFocusError: false,
defaultValues: {
title,
description,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectCreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ProjectCreateForm: React.FC = () => {
resolver: zodResolver(schema),
mode: 'onChange',
reValidateMode: 'onChange',
shouldFocusError: true,
shouldFocusError: false,
});

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/TeamCreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const TeamCreateForm: React.FC = () => {
resolver: zodResolver(schema),
mode: 'onChange',
reValidateMode: 'onChange',
shouldFocusError: true,
shouldFocusError: false,
});

useEffect(() => {
Expand Down

0 comments on commit b8d159b

Please sign in to comment.