react-final-form icon indicating copy to clipboard operation
react-final-form copied to clipboard

Fields remove not working with foreach array

Open quomark opened this issue 3 years ago • 1 comments
trafficstars

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

I had an array, which is an collection of id for removing from fields. After fields.remove(index), the fields.value does not update immediately, causing next fields.remove(index) error.

What is the expected behavior?

Remove all the field in the array.

Sandbox Link

https://codesandbox.io/s/react-final-form-field-arrays-forked-l2ccvo

Please click the server remove button to test.

What's your environment?

OS: macOS Browser: Chrome "node": "14.19.0" "react-final-form": "^6.5.9", "react-final-form-arrays": "^3.1.3",

quomark avatar Aug 02 '22 02:08 quomark

I changed to use removeBatch mutators. It also go wrong. https://codesandbox.io/s/react-final-form-field-arrays-forked-lhsx2n?file=/index.js

quomark avatar Aug 05 '22 06:08 quomark

With newest versions removeBatch is working fine. https://codesandbox.io/s/react-final-form-field-arrays-forked-oe87sp

gertdreyer avatar Mar 02 '23 18:03 gertdreyer