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

Arrays abnormally show form defaultValues after removeValue & pushValue #1092

Open
fkworld opened this issue Dec 30, 2024 · 0 comments
Open

Comments

@fkworld
Copy link
Contributor

fkworld commented Dec 30, 2024

Describe the bug

Arrays abnormally display form defaultValues after removeValue & pushValue.

It appears that a Field mount has been triggered.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/vibrant-zhukovsky-9x3l6s

Steps to reproduce

  1. Click delete to delete name1
  2. Click delete to delete name2
  3. Click Add person to add new person,will show name1 & name2, which is form defaultValues.

Expected behavior

Expect show empty value when add person.

How often does this bug happen?

Every time

Screenshots or Videos

Image

Platform

  • OS: macOS 15.2
  • Browser: Edge 131.0.2903.112

TanStack Form adapter

react-form

TanStack Form version

v0.41.0

TypeScript version

v5.6.3

Additional context

A valid solution:
When pushing a value, assign a new value. Like pushValue({ name: "" })

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