Skip to content

Field meta out of date when setting object field #2113

@marc-niclas

Description

@marc-niclas

Describe the bug

Let's say you have a field { a: { b: 0 } }.

If that field has validation on a.b that says it must be greater than 0, you will have field meta error.

If you programmatically set a to { b: 1 }, the field meta error will not go away.

Your minimal, reproducible example

https://stackblitz.com/edit/vitejs-vite-7o8e4iwp?file=src%2FApp.tsx

Steps to reproduce

  1. Click on button 1
  2. Click on button 2 (at this point the field meta errors should be gone and the form should be valid)
  3. Click on button 3 (now the field meta errors are gone, only be explicitly setting all nested fields)

Expected behavior

In my simple example above, if I set a to { b: 1 }, field meta errors should be gone.

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

  • macos
  • chrome

TanStack Form adapter

None

TanStack Form version

1.28.6

TypeScript version

No response

Additional context

This issue I submitted is duplicate #2069

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions