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

When dragging with inertia, setting the display of the drag element to "none" causes error. #144

Closed
Tummyache opened this issue Dec 29, 2014 · 1 comment

Comments

@Tummyache
Copy link

I'm making a kind of web app/desktop hybridy thing where all of the "pages" are on one html doc that shows and hides the elements as necessary. I noticed that when a drag element with inertia is flung (setting the resistance very low makes it more noticeable) and the element is hidden while the drag is still moving, the entire library stops functioning.

The culprit is the "setRestriction" method where it looks for the x and y elements in the restriction object. Because for some reason (probably the element being hidden) the restriction is undefined at that point.

The workaround I have now is to put

if (!restriction)
{
    return status;
}

before it looks for the x and y element in the restriction object. Don't want to make a pull request at this time because I'm not tooooootally sure that this fix doesn't also break something else.

@taye taye closed this as completed in c3ec7f4 Dec 30, 2014
@taye
Copy link
Owner

taye commented Dec 30, 2014

I wasn't sure if that would work either so I went with a safer option of setting the restrictedX/Y to be page.x/y and then do the rest of the status checks as normal. Thanks for having a look at it.

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

No branches or pull requests

2 participants