Opened 6 years ago

Closed 6 years ago

#9813 closed bug (duplicate)

Item remains sortable if even its class changes to no longer match the `items` selector options

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

Description

Example here:

http://jsfiddle.net/6zwwj/

Note the {items:".sort-item"} option.

Expected:

After clicking the button (which will remove the sort-item class), the "special" item should no longer be sortable.

Current Behaviour:

The item remains sortable.

This is probably because the _mouseCapture function iterates through the current element's parents checking only for the presence of the sortable data attribute, without actually ensuring it is still part of this.items. Either this check should be performed, or (maybe better, though I am not sure about the performance implications), all sortable data attributes should be purged at the beginning of _refreshItems (before being added back).

Change History (1)

comment:1 Changed 6 years ago by tj.vantoll

Resolution: duplicate
Status: newclosed

Duplicate of #8532.

Note: See TracTickets for help on using tickets.