angular2-draggable icon indicating copy to clipboard operation
angular2-draggable copied to clipboard

Dragging lags and gets stuck

Open techn1fire opened this issue 7 years ago • 7 comments

If a user moves a div fast enough that the cursor hovers over a button or link it will break the drag until the div is clicked to reset.

techn1fire avatar Jun 09 '17 22:06 techn1fire

Not sure that jQuery is being used, but this might help: https://stackoverflow.com/questions/5758090/dragging-a-div-in-jquery-fine-when-mouse-is-slow-but-fails-on-fast-mouse-move

techn1fire avatar Jun 09 '17 23:06 techn1fire

@ThisGuyRghtHereee Thanks for your suggestions! But I could not reproduce this issue. Currently, my implementation is similar with the solution you mentioned.

xieziyu avatar Jun 12 '17 14:06 xieziyu

Not sure, but I'm still having the issue. Not limited to my computer, and I am not running any ambiguous code... I don't know why I would get lag, or loss of control of the drag. I'm suggesting maybe there might be a bug with how you are watching the cursor.

techn1fire avatar Jun 14 '17 22:06 techn1fire

I have been noticing the "getting stuck" behavior occasionally with using multiple draggable divs simultaneously, often when partially overlapping. I'm still trying to puzzle through it myself. @ThisGuyRghtHereee, not sure if you still have this issue, but are you sure it doesn't have to do with

  1. The positioning and/or overlap of your draggable elements?
  2. Is it possible that the user agent style sheet for some elements is preventing dragging, or is this just a plain empty div?

Also, don't be afraid to crack open the directive and take a quick read. It's pretty easy to get a feel for how it works. I found that it was a much thinner directive than I expected :)

DanielCaspers avatar Aug 29 '17 18:08 DanielCaspers

The div is on top of all elements on the page, and it is the only container with drag functionality on it. As to what's preventing dragging, there is a button and some text in the div. The button disables on the drag start event. And re-enables when stopped. capture This is the div (in yellow) It works fine until I try and move the mouse at a slightly faster speed.

techn1fire avatar Aug 29 '17 19:08 techn1fire

Playing with it a little more, it looks like it stops if the cursor move too fast and hovers over something other than the div itself, including whatever is behind it outside of the div, and the disabled button when it's being dragged. The cursor should be watched once it starts dragging the div, and watch the position regardless of what it's over until it is let go.

techn1fire avatar Aug 29 '17 19:08 techn1fire

Any update on this? Experiencing the same issue.

traviskroot avatar Oct 26 '20 16:10 traviskroot