formik-mui icon indicating copy to clipboard operation
formik-mui copied to clipboard

Validation respect global settings

Open LitaHavr opened this issue 3 years ago • 1 comments

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 .

LitaHavr avatar May 25 '22 07:05 LitaHavr

@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

cliedeman avatar Jun 28 '22 20:06 cliedeman