Opened 9 years ago

Closed 9 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:


Example here:

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


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 9 years ago by tj.vantoll

Resolution: duplicate
Status: newclosed

Duplicate of #8532.

Note: See TracTickets for help on using tickets.