Opened 8 years ago
Last modified 8 years ago
#12573 open bug
Draggable: Incorrect position when using containment and leaving a sortable
Reported by: | crash1912 | Owned by: | crash1912 |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.draggable | Version: | 1.11.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The problem is the draggable element when I exceeds limit defined in "containment" ... the "helper" in this moment away from the pointer, which is a major hassle ...
The code JS:
$(".sortable").sortable({ containment: '.demo', }); $(".draggable").draggable({ containment: '.demo', connectToSortable: '.sortable', });
HTML:
<div class="demo"> <ul> <li class="draggable ui-state-highlight">Arrastrame fuera</li> </ul> <ul class="sortable"> <li>Item 1</li> <li>Item 2</li> <li>Arrastrame fuera</li> <li>Item 4</li> <li>Item 5</li> </ul> </div>
JSFIDDLE DEMO: https://jsfiddle.net/oooer0hp/4/
Web Browsers affected: ALL, firefox, chrome, safari... Help please...
Change History (4)
comment:1 follow-up: 2 Changed 8 years ago by
Owner: | set to crash1912 |
---|---|
Status: | new → pending |
comment:2 Changed 8 years ago by
Status: | pending → new |
---|
Replying to scott.gonzalez:
I don't see any problem; the element *can't* follow the cursor since that's exactly what the
containment
option *is*. What exactly do you expect to happen?
Please, see demo:
mouse loses element!
comment:3 follow-up: 4 Changed 8 years ago by
Status: | new → open |
---|---|
Summary: | jQuery UI Issue when use Draggable items connected to Sortable list AND Containment is defined → Draggable: Incorrect position when using containment and leaving a sortable |
Ok, so the problem is that when the draggable leaves the sortable and the cursor is outside of the containment, the draggable is forced to a new location which isn't accounted for in the cursor offset. Here's a reduced test case: https://jsfiddle.net/oooer0hp/7/
comment:4 Changed 8 years ago by
Replying to scott.gonzalez:
Ok, so the problem is that when the draggable leaves the sortable and the cursor is outside of the containment, the draggable is forced to a new location which isn't accounted for in the cursor offset. Here's a reduced test case: https://jsfiddle.net/oooer0hp/7/
Doesnt work, problem is same. With "parent" fix the problem, BUT NOT ALWAYS is possible use "parent"... in jquery ui 1.10 this problem not exist, appears in 1.11...
I need solve this problem, please, help...
I don't see any problem; the element *can't* follow the cursor since that's exactly what the
containment
option *is*. What exactly do you expect to happen?