Opened 12 years ago

Closed 9 years ago

#7044 closed bug (notabug)

Draggable: appendTo option doesn't work together with helper: 'original'

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

Description

from draggable plugin

_createHelper: function(event) {
...
if(!helper.parents('body').length)	
helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
...
}

The if conditions means it, and it is. Looks like bug.

Change History (6)

comment:1 Changed 12 years ago by rdworth

Component: ui.coreui.draggable
Version: 1.8.91.8.10

comment:2 Changed 12 years ago by rdworth

Summary: Append to doesn't work with original helperDraggable: appendTo option doesn't work together with helper: 'original'

Minimal test page http://jsbin.com/inoye3

comment:3 Changed 12 years ago by rdworth

In order to fix this, we would need to keep a reference to the original element's parent and index, for returning it back there. Such a reference rather than a placeholder element, as no one element type (such as div) can be put in place of all other elements (such as an li).

A workaround in the meantime is to use helper: "clone" and hide the original on dragStart and show and dragStop.

Version 0, edited 12 years ago by rdworth (next)

comment:4 Changed 10 years ago by Scott González

Milestone: 1.9.02.0.0

comment:5 Changed 10 years ago by mikesherov

Status: newopen

comment:6 Changed 9 years ago by mikesherov

Milestone: 2.0.01.11.2
Resolution: notabug
Status: openclosed

This is expected and the documented behavior. I've opened a ticket to clarify it further, but this won't be fixed: https://github.com/jquery/api.jqueryui.com/issues/224

Note: See TracTickets for help on using tickets.