Opened 4 years ago

Closed 4 years ago

#10736 closed bug (notabug)

Draggable connected to sortable adds helper instead of item

Reported by: electricsam Owned by:
Priority: minor Milestone: none
Component: ui.draggable Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:

Description

When connecting a draggable to a sortable with a helper, the helper is added to the sortable instead of the item. Also, the ui.item in the stop callback is the helper and the ui.helper is null.

This used to work in jQuery UI 1.9.2.

Here is a JSFiddle: http://jsfiddle.net/8Lg4rexz/2/

Change History (1)

comment:1 Changed 4 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

This is expected behavior. The helper property is set to null because it's referring to the sortable's helper, which is not relevant when adding an external draggable. The helper is what is intended to be added to the sortable. If you look at the connectToSortable option's docs (http://api.jqueryui.com/draggable/#option-connectToSortable) it notes that “The helper option must be set to "clone" in order to work flawlessly”.

Note: See TracTickets for help on using tickets.