#4977 closed bug (fixed)
Droppable: tolerance, pointer - bug when pointer outside draggable
Reported by: | kevin.wells | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.11.1 |
Component: | ui.droppable | Version: | 1.8a1 |
Keywords: | haspatch | Cc: | |
Blocked by: | Blocking: |
Description
Use case
I have a draggable
window for which the title bar acts as a handle
. So it is only possible to drag the window by clicking in the title bar at the top of the window. I've set the containment
of the window so it cannot be dragged outside the view port.
I have two droppable
elements at the bottom of the view port, one on top of the other. The droppable
elements are not as tall as the draggable
. There is no way to drag the window onto the lowermost droppable
.
I tried setting the tolerance
of the droppable
elements to pointer
to resolve this problem. Even though I could move the pointer
over the bottom droppable
element I could not drop the window on the bottom element.
The problem occurs because the code in droppable
assumes that the mouse pointer is always in the same position relative to the draggable
that it was in when the user clicked the mouse to start dragging, or that it is always at the cursorAt
position. This invariant does not hold when containment
has been specified for the draggable
and the draggable
is close to the boundaries of the "container".
How to reproduce
I've attached a patch that adds a unit test to reproduce the problem.
How to fix
I've attached a patch that fixes the problem.
Attachments (2)
Change History (13)
Changed 14 years ago by
Attachment: | droppable_pointer_test.patch added |
---|
Changed 14 years ago by
Attachment: | droppable_pointer_fix.patch added |
---|
comment:1 Changed 13 years ago by
Milestone: | TBD → 1.8 |
---|---|
Priority: | minor → major |
comment:2 Changed 13 years ago by
I've applied this patch to tag 1.8.4 and to the master branch. You can pull it from here:
http://github.com/kevin-wells-iq4bis/jquery-ui/blob/3b7c347b03751deaae19875ff7ae1700e6455f1a
comment:3 Changed 11 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:4 Changed 11 years ago by
Keywords: | haspatch added |
---|---|
Status: | new → open |
Summary: | tolerance, pointer - bug when pointer outside draggable → Droppable: tolerance, pointer - bug when pointer outside draggable |
comment:5 Changed 10 years ago by
I've submitted a pull request for this, updated to work on the current master. see https://github.com/jquery/jquery-ui/pull/991
comment:6 Changed 10 years ago by
FWIW, I've tested the pull request at https://github.com/jquery/jquery-ui/pull/991 against v1.10.3 and it works.
What's the next step here?
comment:9 Changed 9 years ago by
Adding fiddle from the most recent duplicate http://jsfiddle.net/joshgreifer/Y6KM9/
comment:10 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Droppable: only consider pointer location with tolerance "pointer"
Fixes #4977 Closes gh-991
Changeset: 87081b855c5ded96039d16791a30ff0181fb5a9f
comment:11 Changed 9 years ago by
Milestone: | 2.0.0 → 1.11.1 |
---|
Thanks for the patches.