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

If draggable element has position fixed then autoScroll works wrong #196

Closed
bumbu opened this issue Jun 3, 2015 · 0 comments
Closed

If draggable element has position fixed then autoScroll works wrong #196

bumbu opened this issue Jun 3, 2015 · 0 comments

Comments

@bumbu
Copy link

bumbu commented Jun 3, 2015

Here is the example http://jsfiddle.net/bumbu/qjudjkxa/

Everything works right if page is not scrolled, but if you:

  • scroll the page to bottom (or by any meaningful amount)
  • to drag any element
    then container is automatically scrolled to top.

A video example is on youtube. You can see that when page is not scrolled - autoscroll works fine, it is scrolled then no matter which way I drag it will scroll to the top.

This happens because in autoScrollMove mousePointer uses clientX/Y values which are relative to visible viewport of the browser but getElementRect takes in account page scroll (which shouldn't be used for fixed elements).

If I try to ignore scroll values from getElementRect then autoScroll and restriction do not work or work badly.

@taye taye closed this as completed in 3635840 Jun 14, 2015
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

1 participant