-
-
Notifications
You must be signed in to change notification settings - Fork 538
Open
Description
Describe the bug
I'm not 100% that this is a bug, but the behaviour is counter intuitive for me at least.
I have an array of objects in my data structure and show their values via form.Field mode="array" with useFieldContext.
When I delete an existing entry and add a new entry with undefined properties, properties from the deleted row are used.
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-idrzagoh?file=src%2Fminimal.tsx
Steps to reproduce
Click the last row to remove it.
Click add.
Un/Comment lines 15-18.
Lines commented with "works fine" will display the empty value.
Lines commented with "does not work" will display the value from the previously removed row.
Expected behavior
I'd expect that the newly added row is empty, even if their properties are undefined.
How often does this bug happen?
Always
Platform
See Stackblitz example
TanStack Form version
1.23.8
Metadata
Metadata
Assignees
Labels
No labels