Skip to main content

Search and Top Navigation

#9425 closed bug (patcheswelcome)

Opened July 12, 2013 06:50PM UTC

Closed August 07, 2013 12:48PM UTC

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

Attachments (0)
Change History (3)

Changed July 13, 2013 01:58AM UTC by tj.vantoll comment:1

status: newopen
summary: Calling cancel on a sortable item fails if set to animate on revertSortable: 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.

Changed July 15, 2013 01:46PM UTC by jpevarnek comment:2

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

Changed August 07, 2013 12:48PM UTC by scottgonzalez comment:3

resolution: → patcheswelcome
status: openclosed

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.