Describe the bug
There appears to be a regression introduced in react-form@1.28.4 where validation is firing on submit but not in react-form@1.28.3.
After showing and hiding the field isTouched is false for 1.28.3 but true for 1.28.4
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-wr2gnlx5
Steps to reproduce
- Check "Enter first name"
- Click "Submit", you will see a "You must enter a name" error
- Uncheck "Enter first name"
- Click "Submit"
- You should see an alert indicating the submission was successful and the were no validation errors
In the terminal run, the following and repeat the steps
npm i @tanstack/react-form@1.28.4
npm install && npm run dev
This time the validation runs again on submit causing a validation error preventing submission
Expected behavior
I would expect the same behaviour across both version, specifically for the field to not be validated as it's been reset
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
See reproduction
TanStack Form adapter
react-form
TanStack Form version
v1.28.3
TypeScript version
No response
Additional context
No response