Skip to main content

Search and Top Navigation

#11085 new bug ()

Opened February 11, 2015 01:54PM UTC

Last modified February 11, 2015 01:54PM UTC

Helper created by draggable is moved to another parent when over sortable

Reported by: syl.fabre Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:

1. Create a draggable and a sortable

2. Start dragging an element from the draggable list

> Helper's parent is the draggable list: OK

3. Drag the element over the sortable

> Helper's parent becomes the sortable list

4. Drag the element out of the sortable

> Helper's parent is still the sortable list.

This is a problem because :

  • the helper css position is "absolute". So it's relative to its first ancestor that css position is different from "static" : the helper is placed relatively to the sortable
  • the helper position is computed based on the draggable list

It's OK if the draggable list and the sortable list are css "static" and share the same parent. But if not, then the helper is moved away from the mouse cursor.

JS Fiddle :

In the JS fiddle:

  • if the helper is drag over the 2nd sortable which is css "static", the helper is in the right place, near the mouse cursor.
  • if the helper is drag over the 1st sortable which is css "relative", the helper is misplaced.

In my own opinion, the sortable should "give back" the helper to the draggable

Attachments (0)
Change History (0)