Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation respect global settings #327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LitaHavr
Copy link

Changed validation "behavior" of components inside formik-mui-lab and Select component to respect global settings of validation .

Why?
After onBlur or onChange validation is called , but not in every cases it will be useful , for example if you need validation only after submit . Now it's not possible to set this options like validateOnChange={false} you need to change this options right inside the component .

@cliedeman
Copy link
Collaborator

cliedeman commented Jun 28, 2022

@LitaHavr thanks for the PR.

Looking at the formik source code won't this change override validateOnChange ?

https://github.com/jaredpalmer/formik/blob/00acf558763085e048400ce9d1ef6f40cd8c5518/packages/formik/src/Formik.tsx#L699

Edit: setFieldTouched does not even use validateOnChange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants