Closed johnrom closed 3 years ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days
I think this issue is resolved since we removed the underlying scheduling mechanism.
🐛 Bug report
Current Behavior
Currently, when low priority validation is scheduled, the next render doesn't have access to that information.
Expected behavior
We should be able to test when validation is scheduled, because
values
anderrors
may not match.Reproducible example
In the following example, I have a test for isValidating and errors.myNumber. I am double-validating with a special
div
that prints the message "This message should never appear." when the form is not validating but the value withinvalues
is not valid. The validation is scheduled during this time, and that should be something we can detect and prevent this message from displaying.https://codesandbox.io/s/formik-codesandbox-template-forked-rozm4?file=/index.js
Suggested solution(s)
I think
isValidating
should betrue
during renders when low priority validation is scheduled. Or we need to add another prop likewillValidate
orisValidationScheduled
to test for this case.Your environment
See sandbox.