Opened 10 years ago

Closed 10 years ago

#9425 closed bug (patcheswelcome)

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 (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 (3)

comment:1 Changed 10 years ago by tj.vantoll

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 -

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 10 years 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 10 years ago by Scott González

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.

Note: See TracTickets for help on using tickets.