state.canSubmit value flickering with async validation
Describe the bug
https://tanstack.com/form/latest/docs/framework/react/examples/simple In this example just start typing and you'll notice the submit button flickers on and off
Your minimal, reproducible example
https://tanstack.com/form/latest/docs/framework/react/examples/simple
Steps to reproduce
- Continuously type in the First Name input
- Notice the submit button's disabled state is flickering on and off
Expected behavior
I would expect the submit button to be disabled until the debounce and validation promise finishes
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Chrome, MacOS Sonoma 14.5
TanStack Form adapter
react-form
TanStack Form version
0.29.1
TypeScript version
No response
Additional context
No response
canSubmit seems to be working as intended, that is disabled while the form is validating. There's something that seems off though, namely the isValidating flag on the field.
If you type something and type again before the debounce, it seems that even if the validator is running, the isValidating is set to false.
This issue has been fixed by https://github.com/TanStack/form/pull/962, so I'm closing it.