Skip to content

Update beautiful dnd example #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

tim-mccurrach
Copy link
Contributor

Fix React beautiful dnd example

Thanks, for the library :) I've very much enjoyed using final-forms. The current example with react-beautiful-dnd here uses the following for makeOnDragEndFunction drop:

fields.swap(result.source.index, result.destination.index);

This has the effect, that if you start off with #1, #2, #3, #4 and you move #4 to the second position, then after the drop, #2 jumps to the end position, which is unexpected. I have forked the example on sandbox, and updated this line to become:

fields.move(result.source.index, result.destination.index);

and also updated the link in the readme to the new sandbox.

@codecov
Copy link

codecov bot commented May 14, 2020

Codecov Report

Merging #135 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #135   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines           60        60           
  Branches        10        10           
=========================================
  Hits            60        60           

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 b40b90d...64d85c3. Read the comment docs.

@erikras erikras merged commit c5d75d7 into final-form:master Jul 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants