Open prajavk opened 5 years ago
Hi,
The codesanbox link is broken.
Sorry, I corrected it https://codesandbox.io/s/formik-with-yup-bbgbz
I'm pretty sure you have to add the onBlur listener to your fields. For example
onBlur={formProps.handleBlur}
🐛 Bug report
My form using yup and is not validating onBlur and onChange on . It validates only onSubmit. How to solve this?
Current Behavior
yup validation not triggered onchange of
when I submit an invalid form (and the validation errors start showing), then onChange validations start working. As I press a key, the validation takes place immediately. So I must be missing something in this fiddle example.
Expected behavior
Form should show errors messages onBlur of
Reproducible with this example
Here I added 3 fields - name {html input}, email { Field component with custom handler} , password { component handles change event using props }
https://codesandbox.io/s/formik-with-yup-bbgbz
Suggested solution(s)
Please allow validateOnBlur or ValidateOnChange for
Additional context
I saw this closed issue, https://github.com/jaredpalmer/formik/issues/1442 Want to know, how to deal this business use case.
Your environment