final-form / final-form/react-final-form-arrays

Bug - deleting row

Open
#145 4 comments 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
210
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Assuming we render the array with editable items,
like so, `{fields.map((arrPrefix) => }`

When deleting a row of a field array
all of the indexes following the row becomes dirty, in the `form.dirtyFields`.

I think it happens because the Field component of say item[1].val1 `isEqual` will return false once deleting say item[0].val1.
I think the isEqual should be different when the `Field` is looking at a nested array field, surely a change in `Field` would be wrong, but Im thinking there should at least be a `FieldArrayCell` that will render also accept id prop(along with `Field` props) and will use this to send the `isEqual` the correct values, and then, the isEqual will evaluate correctly, and `form.dirtyFields` will be correct.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.