final-form / final-form-arrays

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

Moving or swapping preserves initialValues #63

Open shulcsm opened 3 years ago

shulcsm commented 3 years ago

I suspect this is by design but swapping rows moves values but keeps initialValues. Change handlers get fired for moved rows and meta.dirty is set. Is there a way to avoid it it? From my point of view array is now dirty, but individual values should be kept clean.

I pondered writing a mutator that swaps/moves initialValues but it seems awkward especially if you want to move newly created rows, that have undefined initialValues.