issue: Form validation behavior changes when the isValid form state is subscribed #11924
Open
1 task done
Labels
question
Further information is requested
Version Number
7.51.5
Codesandbox/Expo snack
#11923
Steps to reproduce
Hello,
kind of specific edge case but we found the issue in our production app. I created a PR with a cypress test to showcase the issue. It appears that async field validation is not working as expected (or at least the behavior is not the same) if the
isValid
form state is subscribed. If a field is blured before the debounced validation ever happens the field will never be validated. Also as far as I looked into it, this only happens in combination with modeonChange
and a debounced validation function.I am not quite sure if the debouncing approach is the problem but in my opinion it is a somewhat flaky implementation if we end up with different behavior depending on if
isValid
is subscribed or not.I also tried to...
isValid
withuseFormState
which lead to the same result.This issue was not introduced with the current version. We found it in
7.50.1
.Expected behaviour
The validation behavior should not depend on the
isValid
state. I expect the form to behave as in the example whereisValid
is not subscribed to.What browsers are you seeing the problem on?
Firefox, Chrome
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: