Jump to content
Search Community

Draggable on a scrolled container doesn't follow mouse properly

7linternational test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

When a container is scrolled and set to visible when drag starts the draggable element is offset to the mouse cursor. I created a small demo to show this:

https://stackblitz.com/edit/gsap-react-basic-f48716-w6gvjb?file=src%2FBoxItem.js  

(drag the boxes that are visible after the container is scrolled).

Is there a way to avoid this behaviour? The reason that I'm doing the overflow: auto/visible is that the draggables cannot be dragged while the overflow is auto or hidden.

See the Pen BoxItem.js by edit (@edit) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...