-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Removal of objects from nested arrays doesn't work as expected #1171
Comments
Updated the code to be simpler. Let me know if the issue is clear enough if not I'm happy to polish up the example more |
Yeah, apologies @Oudwins I'm not clear what's happening in this example or what the bug you're suggesting exists is 😅 |
Oh, thats a shame. I can try to make an even more minimal example and explain it further. But for that it would be very helpful if you could explain a little bit further what you have understood (if any) and what you are confused about specifically. I know this is hard if you don't understand anything but it's very hard for me to figure out a better explanation if I don't know what is confusing |
From what I can tell, the On a subsequent render cycle, it's then re-added to the values: Changing the key on the div from |
Oh, in that case; does v0.48.1 solve this issue for removeValue? |
On v0.48.1, remove value gets exactly the same bug Doing a deep dive right now, but largely the bug is caused by Trying to understand how key on the div is related. |
I spent all day trying to debug this on 0.48.1 yesterday but 1.0 launched in the middle! and I saw #1199. Sadly it doesn't resolve the issue even with Still a mystery though; when |
Describe the bug
When removing an object from a nested array only the "id" field is removed from the element. This happens both if you use arrayField.removeValue and form.setFieldValue.
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-form-dbycl9vt?file=src%2Findex.tsx
Steps to reproduce
Expected behavior
The object is correctly removed. No key error is triggered. React renders the new list correctly.
How often does this bug happen?
Every time
Screenshots or Videos
tanstack-form-issue.mp4
Platform
TanStack Form adapter
None
TanStack Form version
^0.43.2
TypeScript version
No response
Additional context
Example is a little chaotic. Monday I can clean it up. But I think the video shows what is happening quite well.
The text was updated successfully, but these errors were encountered: