-
-
Notifications
You must be signed in to change notification settings - Fork 594
Description
Describe the bug
isValidating form state updates to false before debounced async validation completes. For example when the first async validation is resolving and a second async validation is triggered, once the first async validation resolves, isValidating is set to false even though the second async validation is still in flight.
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-s6svm3er?file=src%2Findex.tsx
Steps to reproduce
- Type in "erro" in firstname
- Wait roughly half a second then add an "r" to make "error"
- isValidating disappears -> false
- After about half a second later the error appears
Expected behavior
As a user I expect, isValidating to be true whenever there is an async validation in flight. So the isValidating... text should not disappear before all async validations have completed. My specific use-case is showing a loading state while async validation is ongoing, however since the isValidating
state becomes false early this can be misleading to users.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Google Chrome
TanStack Form adapter
react-form
TanStack Form version
1.28.3
TypeScript version
v5.8.3
Additional context
No response