Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#5229 closed bug (worksforme)

.sortable( 'cancel' ) cancels whole item drag

Reported by: Chealer Owned by:
Priority: minor Milestone:
Component: ui.sortable Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

.sortable( 'cancel' ) is supposed to behave like this:


Signature:

.sortable( 'cancel' )

Cancels a change in the current sortable and reverts it back to how it was before the current sort started. Useful in the stop and receive callback functions.

If the sortable item is not being moved from one connected sortable to another:

$(this).sortable('cancel');

will cancel the change.

If the sortable item is being moved from one connected sortable to another:

$(ui.sender).sortable('cancel');

will cancel the change. Useful in the 'receive' callback.


The first line works as expected, but the second doesn't. If two sortables A and B are connected and one wants to keep B's content constant, he could use cancel on B so that a drag between A and B would only affect A. But this doesn't work. If for example A's receive event handler has $(ui.sender).sortable('cancel'); and an item is dragged from B to A, both A and B are unchanged. The item is not added to A.

Change History (2)

comment:1 Changed 9 years ago by Scott González

Resolution: worksforme
Status: newclosed

The change is cancelled. Canceling the sort is the same as the sort never occurring. If you need help implementing what you expected, please ask on the forum.

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

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.