Skip to content

Commit

Permalink
Avoid validating onBlur on asynch (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 committed May 8, 2023
1 parent b4680ac commit 4392895
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const AddApplicationButton: React.FC<AddApplicationButtonProps> = ({
validationSchema: AddApplicationsUploadFilesFormSchema(false),
onSubmit: handleUploadFilesFormikSubmit,
// initialErrors: { applications: "" },
validateOnBlur: false,
});

const serverPathFormik = useFormik({
Expand All @@ -124,6 +125,7 @@ export const AddApplicationButton: React.FC<AddApplicationButtonProps> = ({
),
onSubmit: handleServerPathFormikSubmit,
initialErrors: { serverPath: "" },
validateOnBlur: false,
});

const handleOnTabChange = (selected: AddApplicationsTabsType) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const AddApplications: React.FC<AddApplicationsProps> = ({
onSubmit: handleUploadFilesFormikSubmit,
initialErrors:
project && project.applications.length > 0 ? {} : { applications: "" },
validateOnBlur: false,
});

const serverPathFormik = useFormik({
Expand All @@ -150,6 +151,7 @@ export const AddApplications: React.FC<AddApplicationsProps> = ({
),
onSubmit: handleServerPathFormikSubmit,
initialErrors: { serverPath: "" },
validateOnBlur: false,
});

const handleOnTabChange = (selected: AddApplicationsTabsType) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const CreateProject: React.FC<CreateProjectProps> = ({
validationSchema: projectDetailsFormSchema(project),
onSubmit: handleOnSubmit,
initialErrors: !project ? { name: "" } : {},
validateOnBlur: false,
});

const handleOnGoToStep = (newStep: NewProjectWizardStepIds) => {
Expand Down

0 comments on commit 4392895

Please sign in to comment.