Open quyle92 opened 1 year ago
Refer - https://codesandbox.io/s/formik-field-validate-not-working-when-using-hof-forked-whn8rj Validation triggers on blur, on change and on submit So you will have to set them false in the properties of Formik component. There's more on documentation about the same.
Thanks but how about the FastField
issue? (i.e when there is onblur
event triggered on email
field, name
field also gets validated, which I expect it should not).
Hi! I'm quite new to Formik and ran into an issue using field-level validation. Not sure if it's a bug or my fault.
Describe the bug: When using 's relevant parts.
<Field validate={...} />
the validation gets called twice. I've tested with sample code in Formik doc but still have same issue. Also, another problem is thevalidateAsync
triggers even when user fills in other fields. I've already triedFastField
but it still re-renders when there are no direct updates to theTo Reproduce: A stripped down example of both cases can be found in this CodeSandbox.
Expected behavior: I would expect the
validateAsync
atvalidate
prop should be called once per validation for performance reason. And the current field validation should not be triggered when there is no direct update happening.Any help would be much appreciated! Thanks.