final-form / final-form-arrays

Array Mutators for 🏁 Final Form
https://final-form.org/arrays
MIT License
70 stars 40 forks source link

form.mutators.removeBatch Removes wrong data #97

Open xilovesyu opened 1 year ago

xilovesyu commented 1 year ago

Are you submitting a bug report or a feature request?

Bug report

What is the current behavior?

removed data by id from 5 -10

What is the expected behavior?

Should remove id from 4 to 16 and keep the data with id 1 to 3

Sandbox Link

Sandbox Link Here

What's your environment?

"final-form": "4.20.9", "final-form-arrays": "3.1.0", "loader-utils": "3.2.1", "react": "18.2.0", "react-dom": "18.2.0", "react-final-form": "6.5.9", "react-final-form-arrays": "3.1.4"

Other information

xilovesyu commented 1 year ago

Seems https://github.com/final-form/final-form-arrays/blob/master/src/removeBatch.js#L38 we should use sort there.