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 introduced in 2.16.0 while dragging with revert position [proposed solution inside] #593

Closed
chino23 opened this issue Apr 26, 2016 · 4 comments

Comments

@chino23
Copy link
Contributor

chino23 commented Apr 26, 2016

#567 introduced a fix for the revert position. However, the way my table is set up, it produces a major error which seems easy to fix.

The added code of #567 reads:

if( dnd.smartRevert ) {
    // #567: fix revert position
    rect = node.li.getBoundingClientRect();
    parentRect = $(draggable.options.appendTo)[0].getBoundingClientRect();
    draggable.originalPosition.left = Math.max(0, rect.left - parentRect.left);
    draggable.originalPosition.top = Math.max(0, rect.top - parentRect.top);
}

however, I'm running the DND extension with tables. Therefore,

node.li -> null
node.tr -> I'm here

changing

node.li

to

node.tr

fixes the problem for me.
So I guess we need a check if node.li is null, that we use node.tr.

@allenfantasy
Copy link

Found the same issue with the OP, and I posted the detail in #114

@mar10
Copy link
Owner

mar10 commented Apr 27, 2016

Thanks for reporting!

@mar10 mar10 closed this as completed in e216764 Apr 27, 2016
@allenfantasy
Copy link

👍

@chino23
Copy link
Contributor Author

chino23 commented Apr 27, 2016

Thanks for the quick fix!

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

No branches or pull requests

3 participants