First input ignored after action completes
Describe the bug
After submitting the form and the action returns, the first input on the form is ignored.
Your minimal, reproducible example
https://github.com/aaronfulkerson/tanstack-form-validation
Steps to reproduce
- Don't enter any values
- Hit submit
- Wait for the action to complete (3 seconds in the repo provided)
- Attempt to add a value to the form
Expected behavior
As a user I expected the form to respond to my input but instead the first input is ignored.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- macOS 15.3.2
- Arc
- 1.86
TanStack Form adapter
react-form
TanStack Form version
1.1.0
TypeScript version
5.8.2
Additional context
No response
The serverValidate method returns the old values as part of the error, which get merged back over your changed state in transform. Unsure why it is done this way but you can delete state.values in the transform method as a short-term fix.
Why does that prevent the form from receiving user input?
The form receives user input, the error result just overwrites it.
The form receives user input, the error result just overwrites it.
No, brother. That’s why I say “wait for the action to complete”. Try it.
Alright I get what you meant, but the reason is the same, the error result that has empty fields gets merged over state on first keypress for some reason.