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

`form.getFieldState` is corrupted after removing element `arrays.remove`

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

Description

### Are you submitting a **bug report** or a **feature request**?

bug report

### What is the current behavior?

I have the form with FIeldArray component inside.
- "append customer" ie adding new element to array.
- click on the `Set Field Data Here` span -> it set the `data: { disabled: true }`(check in console after next step to ensure data is set) to the the element with `0` index
- then append a new one(index 1).
- click `Set Field Data Here`
- after that - click X to delete the element with index `0`.

In console - check for the the the logging of the zero element(previous first one) -> `data: {}`.

### What is the expected behavior?
In console - check for the the the logging of the zero element -> `data: { disabled: true }`.

### Sandbox Link

https://codesandbox.io/s/react-final-form-field-arrays-forked-dythr?file=/index.js

### What's your environment?

sandbox

### Other information

Tried as described in issue https://github.com/final-form/react-final-form-arrays/issues/128, but it did not help.

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.