Skip to content

Arrays abnormally show form defaultValues after removeValue & pushValue #1092

Closed
@fkworld

Description

@fkworld

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: "" })

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