Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unmounting Field with validation errors prevents form from submitting #1133

Open
asegarra opened this issue Jan 30, 2025 · 0 comments
Open

Comments

@asegarra
Copy link

asegarra commented Jan 30, 2025

Describe the bug

I'm having this issue, unmounting a field does nothing to the form, field is still there included any errors. If this field had any validation errors they still persist and prevents the form from being submitted.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/objective-hawking-n4xwq6

Steps to reproduce

  1. Conditionally render last name by typing something in first name
  2. type a character in last name
  3. remove first name then enter first name again
  4. last name value and validation errors remain

Expected behavior

unmounting a field shouldn't leave behind validation errors that prevent the form from submitting.

How often does this bug happen?

Always

Screenshots or Videos

No response

Platform

  • OS: Windows 10

TanStack Form adapter

None

TanStack Form version

v0.41.3

TypeScript version

No response

Additional context

No response

@asegarra asegarra changed the title unmounting Field does not reset that fields meta including any errors unmounting Field with validation errors prevents form from submitting Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant