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

Draggable elements are offset at random values #191

Open
pixelplant opened this issue Sep 29, 2016 · 0 comments
Open

Draggable elements are offset at random values #191

pixelplant opened this issue Sep 29, 2016 · 0 comments

Comments

@pixelplant
Copy link

Hello Brian

First of all I want to thank you for this awesome plugin.
I am experiencing a strange issue and I hope you have an idea of what I can do as I tried all the possible parameters and I still can't seem to be able to have the desired effect.
I prepared a codepen page so that you can see what I am talking about (Try dragging around the elements that have Bold titles; you will see the drag cursor show up once you hover them)

https://codepen.io/nekosan/pen/qaXkRL

I am developing an application that allows you to drag elements around, and move them from container to container. Once you start dragging, some small divs are created before and after existing content elements (shown with a dashed border) and once you drop the dragged element onto one of this dashed divs, your element will become a child of this div's parent. Everything works fine and elements are moved as they should, the problem that I have is that most of the times the dragged div is offset from the mouse cursor (sometimes below the mouse, sometimes to the right, or the left, sometimes above the mouse, at either 20px or 200px or more, so it's like random)
What I'm trying to do is to have the dragged div to always follow the mouse, and be under it once it is being dragged.

I really tried everything I could think of, reset the positions manually, reset the styles added by pep, trying both with cssTransforms enabled or not, reverting the values or not, no change, I always get the same random offset.

Can you please have a look and let me know if you have any idea how I could handle this situation? I am aware that my dropping zones are created dynamically (once you "initiate" drag) and this might screw the position of the div but in this case I would expect to get a fixed offset, not a random one.

Thank you,
Radu

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