Skip to main content

Search and Top Navigation

#6871 closed bug (wontfix)

Opened January 17, 2011 10:11PM UTC

Closed March 25, 2013 09:12PM UTC

Draggable: helper won't revert to original position if the original item was removed during the drag

Reported by: cburgdorf Owned by: mikesherov
Priority: minor Milestone: 1.11.0
Component: ui.draggable Version: 1.8.8
Keywords: regression Cc:
Blocked by: Blocking:
Description

If you have a draggable set to "helper: clone" and "revert: invalid" it won't revert to the original position if the original element has disappeared in the meantime.

You can spot this behaviour using the red square in this fiddle. You can spot what normally happens when the original element stays there (blue square).

http://jsfiddle.net/cburgdorf/YSEAs/

For me, it feels wrong. I think the helper should revert back to the original position and after that disappear just like the original element.

Attachments (0)
Change History (8)

Changed January 17, 2011 10:14PM UTC by cburgdorf comment:1

I forgot to say. I would love to provide a fix for that myself as long we agree that the current behavour is wrong.

Changed January 19, 2011 01:50PM UTC by Christoph Burgdorf comment:2

resolution: → fixed
status: newclosed

Draggable: Incase helper is not set to 'original' succeed with revert action even if the original element has been removed. Fixes #6871

Changeset: 0ed452bf2581a83781c417dffe6ed4e3dbe2d676

Changed January 19, 2011 01:50PM UTC by scottgonzalez comment:3

milestone: 1.91.8.9

Changed October 26, 2012 12:38PM UTC by mikesherov comment:4

milestone: 1.8.92.0.0
resolution: fixed
status: closedreopened
summary: draggable helper won't revert to original position if the original item has disappeared in the meantimeDraggable: helper won't revert to original position if the original item was removed during the drag

This bug are now present again in 1.9: http://jsfiddle.net/EcwyG/

Changed October 26, 2012 12:38PM UTC by mikesherov comment:5

status: reopenedopen

Changed March 17, 2013 02:00PM UTC by mikesherov comment:6

keywords: → regression
owner: → mikesherov
status: openassigned

The regression here was caused by https://github.com/jquery/jquery-ui/commit/4da1716cfd88ac9b4a8362f715c081c2f75bd316

removing the original calls _destroy, which had a guard clause to not call _mouseDestroy if the original was removed.

In order to correct this behavior, we need to add the guard clause back in and then cause _mouseDestroy to be called after the revert action happens, or something similar. @scott.gonzalez, any thoughts on what correct behavipr here should be?

Changed March 17, 2013 02:02PM UTC by mikesherov comment:7

#6999 is a duplicate of this ticket.

Changed March 25, 2013 09:12PM UTC by mikesherov comment:8

milestone: 2.0.01.11.0
resolution: → wontfix
status: assignedclosed

even though we've previously patched this, I've discussed this with scott_gonzalez and it's not something we're going to support going forward. We're only going to support removing the original on "end" callbacks. In this case, that's "stop" for draggables. I'll open a docs issue shortly to document this.