Bug Tracker

Modify

Ticket #2914 (closed enhancement: invalid)

Opened 5 years ago

Last modified 3 years ago

Draggable: make revert a method

Reported by: ivan Owned by: paul
Priority: minor Milestone: 1.2.4
Component: ui Version: 1.2.3
Keywords: Cc:
Blocking: Blocked by:

Description

A pretty common need with draggables/droppables is to accept the drop, do some processing, and then, if some conditions are not met, restore the draggable to the original position.
I think it would make sense to make 'revert' callable externally (for example in the 'drop' method of the droppable).
The attached patch does that: unfortunately, at the moment it requires setting draggableInstance.cancelHelperRemoval = true; in the draggable 'stop' or in the droppable 'drop' methods, to prevent the helper from being removed too soon (see also  here for a discussion).

Attachments

ui.draggable.js.patch Download (1.8 KB) - added by ivan 5 years ago.

Change History

Changed 5 years ago by ivan

comment:1 Changed 3 years ago by dmethvin

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

This should be filed in the UI bug tracker if still relevant.

 http://dev.jqueryui.com

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.