Ticket #6871 (closed bug: wontfix)

Opened 4 years ago

Last modified 18 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 4 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 4 years ago by Christoph Burgdorf

  • Status changed from new to closed
  • Resolution set to fixed

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 4 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.9

comment:4 Changed 2 years ago by mikesherov

  • Status changed from closed to reopened
  • Summary changed from draggable helper won't revert to original position if the original item has disappeared in the meantime to Draggable: helper won't revert to original position if the original item was removed during the drag
  • Resolution fixed deleted
  • Milestone changed from 1.8.9 to 2.0.0

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

comment:5 Changed 2 years ago by mikesherov

  • Status changed from reopened to open

comment:6 Changed 19 months ago by mikesherov

  • Keywords regression added
  • Owner set to mikesherov
  • Status changed from open to assigned

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 19 months ago by mikesherov

#6999 is a duplicate of this ticket.

comment:8 Changed 18 months ago by mikesherov

  • Status changed from assigned to closed
  • Resolution set to wontfix
  • Milestone changed from 2.0.0 to 1.11.0

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.