final-form / final-form-arrays

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

fix(moveFieldState): get change/blur/focus callbacks from oldState #54

Open SeqviriouM opened 4 years ago

SeqviriouM commented 4 years ago

Previously in function moveFieldState callbacks change/blur/focus is requested by new destKey. But I think it will be more correct to save previous callbacks. For example, when I remove second value from array I will expect it will also remove second callback with it. So I have tuned a bit test cases. It should fix issues #49 #51.

What do you think about this changes?

codecov[bot] commented 4 years ago

Codecov Report

Merging #54 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #54   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines          159       159           
  Branches        34        34           
=========================================
  Hits           159       159           
Impacted Files Coverage Ξ”
src/swap.js 100.00% <ΓΈ> (ΓΈ)
src/insert.js 100.00% <100.00%> (ΓΈ)
src/moveFieldState.js 100.00% <100.00%> (ΓΈ)

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 7e27b5c...f098813. Read the comment docs.

SeqviriouM commented 4 years ago

@erikras can you check, please?