Ticket #9425 (closed bug: patcheswelcome)

Opened 18 months ago

Last modified 17 months ago

Sortable: cancel method called during sort fails if revert option is set

Reported by: jpevarnek Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.10.3
Keywords: Cc:
Blocking: Blocked by:

Description

 http://jsfiddle.net/cxjXM/ (repro notes in the fiddle)

The problem appears to be that cancel clears out this.helper (line 487) while adding a callback to _clear for after the animation finishes (line 445). _clear then fails when attempting to access this.helper (line 1176).

Change History

comment:1 Changed 18 months ago by tj.vantoll

  • Status changed from new to open
  • Summary changed from Calling cancel on a sortable item fails if set to animate on revert to Sortable: cancel method called during sort fails if revert option is set

I can confirm this behavior and that it only occurs when the revert option is set.

The cancel method still works with the revert option if called in a stop or receive event -  http://jsfiddle.net/tj_vantoll/e6hwT/.

I'm not sure that canceling a sort during a drag is a supported use of the cancel method, but this seems like a legit use case so I'll mark this as valid for now.

comment:2 Changed 17 months ago by jpevarnek

Just a quick note regarding this being a supported use case, the code from the fiddle was taken pretty much exactly from a developer comment in #5055

comment:3 Changed 17 months ago by scott.gonzalez

  • Status changed from open to closed
  • Resolution set to patcheswelcome

Canceling a sort is bad UX and will be removed in a future version. With that in mind, we're not likely to spend any time trying to fix this, but we're more than happy to review a pull request from the community.

Note: See TracTickets for help on using tickets.