-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async validation runs into race conditions. #10078
Comments
I am not sure what the issue is here, the validation run twice and that's expected. |
The sequential order here matters, right? The validation should have run twice, but the error message should reflect the most recent edit, not the most recent validation return. What is happening here is that the error message shows the result of validating "1" and not "10." |
can you share a video on this issue? |
Sure. Here's a video using the codesandbox link in the issue. "15" is valid, "1" is not. Notice the flicker from "valid" to "invalid" at the end (along with the error at the top). |
That's impossible for us to resolve your |
The Ultimately what happens here is there are two calls two |
My bad, too busy in the morning, will take a look at it after work. |
Version Number
7.43.5
Codesandbox/Expo snack
https://codesandbox.io/s/nifty-babycat-p934h8?file=/src/App.tsx
Steps to reproduce
This is probably because of the
onChange
mode, which reads "1" and then "10." The validation for "10" returns earlier and thus gets overriden by the validation for "1."Expected behaviour
Validation should only apply on the most recent change handler.
What browsers are you seeing the problem on?
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: