Skip to content
Source
Sign inSign up
TanStack/form

🐛Validation regression bug in react-form@1.28.4 #2084

Send to my agent
Openkimsagro1(GitHub profile, opens in a new tab) opened this issue 1 comment

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

  1. Check "Enter first name"
  2. Click "Submit", you will see a "You must enter a name" error
  3. Uncheck "Enter first name"
  4. Click "Submit"
  5. 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

  1. kimsagro1(GitHub profile, opens in a new tab) changed the title

  2. kimsagro1(GitHub profile, opens in a new tab) changed the title

  3. Hi! I’d like to work on this issue. Could you please assign it to me? I’ll make sure to follow the contribution guidelines. Thanks!

  4. LeCarbonator(GitHub profile, opens in a new tab) added labelsv2: needs investigation

Sign in to join this conversation.