Opened 4 years ago

#11085 new bug

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:

Description

  1. Create a draggable and a sortable
  2. Start dragging an element from the draggable list

=> Helper's parent is the draggable list: OK

  1. Drag the element over the sortable

=> Helper's parent becomes the sortable list

  1. 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 : http://jsfiddle.net/cwkhwcs2/6/

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

Change History (0)

Note: See TracTickets for help on using tickets.