Skip to content

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

@kimsagro1

Description

@kimsagro1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions