You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with array fields, when you remove an item that isn't the last one, the next item is duplicated in the form values.
This is a result from a change introduced in #3166
I have been banging my head against array fields for nearly a week (particularly working with preloaded values, reactive schema, and form resets). Trying to work up a CodeSandbox to get some discussion going on the correct way to work with array fields. Right now I have ton of hacky code to trying to deal with the tug of war between the model and the array driving the count of entries.
Thank you for reporting this, indeed it was related to #3166 because when the fields didn't unset the stale path it would duplicate the values in the case of array fields.
I have implemented a fix for it by cleaning up the old value when the remaining field exchanges its name.
Will tag a patch for this shortly.
@apeling Feel free to create a discussion where you can describe your use case and the difficulties with this and I will try to make it better/easier.
Versions
Describe the bug
Working with array fields, when you remove an item that isn't the last one, the next item is duplicated in the form values.
This is a result from a change introduced in #3166
To reproduce
Steps to reproduce the behavior:
Expected behavior
Form values should only contain 2 users.
Demo link
Codesandbox
The text was updated successfully, but these errors were encountered: