Skip to content
Source
Sign inSign up
TanStack/form

Field meta out of date when setting object field #2113

Send to my agent
Openmarc-niclas(GitHub profile, opens in a new tab) opened this issue 0 comments

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 https://github.com/TanStack/form/issues/2069

  1. LeCarbonator(GitHub profile, opens in a new tab) added labelsv2: needs investigation

Sign in to join this conversation.