Opened 10 years ago

Closed 8 years ago

#6999 closed bug (duplicate)

Draggable: helper doesn't get removed if draggable has been removed during drag

Reported by: PvZ Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.draggable Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:

Description

When a Draggable uses a helper, the helper is not correctly removed if the Draggable has been removed while dragging. An example can be found at jsfiddle. Unfortunately the example uses jQuery UI 1.8.7, which suffered from additional bugs around removal of Draggables while dragging. Reproducing the actual issue will require 1.8.9 or WIP code.

From what I can tell, the problem seems to lie in the following bit of Draggable (around line 197).

//if the original element is removed, don't bother to continue
if(!this.element[0] || !this.element[0].parentNode)
    return false;

Changing this to the following seems to help:

//if the original element is removed, don't bother to continue
if(!this.element[0] || !this.element[0].parentNode) {
    this._clear ();
    return false;
}

Change History (4)

comment:1 Changed 10 years ago by PvZ

The jsfiddle-link I posted in the ticket also exhibits a second bug I was going to report separately. jsfiddle should only exhibit the original issue.

comment:2 Changed 8 years ago by Scott González

Milestone: 1.9.02.0.0

comment:3 Changed 8 years ago by mikesherov

Status: newopen
Summary: Draggable does not remove helper if draggable has been removedDraggable: helper doesn't get removed if draggable has been removed during drag

confirmed: http://jsfiddle.net/RBT6A/ and related to #6871

comment:4 Changed 8 years ago by mikesherov

Resolution: duplicate
Status: openclosed

Duplicate of #6871.
Confirmed this is caused by the same thing as #6871

Note: See TracTickets for help on using tickets.