Opened 7 years ago

Closed 4 years ago

#6871 closed bug (wontfix)

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.

Change History (8)

comment:1 Changed 7 years ago by cburgdorf

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

comment:2 Changed 7 years ago by Christoph Burgdorf

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

comment:3 Changed 7 years ago by Scott González

Milestone: 1.91.8.9

comment:4 Changed 5 years ago by mikesherov

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/

comment:5 Changed 5 years ago by mikesherov

Status: reopenedopen

comment:6 Changed 5 years ago by mikesherov

Keywords: regression added
Owner: set to 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?

comment:7 Changed 5 years ago by mikesherov

#6999 is a duplicate of this ticket.

comment:8 Changed 4 years ago by mikesherov

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.

Note: See TracTickets for help on using tickets.