🐛Validation regression bug in react-form@1.28.4
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.7k
- Forks
- 682
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 7
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and compare @tanstack/react-form versions 1.28.3 and 1.28.4 using the npm commands in the issue. Repeat the field show, submit, hide, and submit sequence while checking isTouched and validation state. Done means the reset field no longer causes a validation error after it is hidden.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100