Skip to content
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

[BUG] Fix cancel revert with copy and copySortSource #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PhilBroadbent
Copy link

@PhilBroadbent PhilBroadbent commented Oct 26, 2017

This PR is to fix a bug relating to calling drake.cancel(true) when using copy: true and copySortSource: true

When copy is false, moving an item within a container and calling cancel with revert: true correct returns the dragged element to the correct position. However, when copy is true (and thus we must also set copySortSource: true else we cannot reorder items in the source container), calling cancel(true) does not return the element to it's original position but instead removes the element.

The fix is to check whether the parent is the same as the source container - if it is, do not remove the element and instead use insertBefore (same as with copy: false), and if it is not, then the element can be safely removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant