Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#8086 closed bug (worksforme)

Cancel sorting disables select element

Reported by: cagdase Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.sortable Version: 1.8.17
Keywords: Cc:
Blocked by: Blocking:

Description

I have implemented a sortable list according to the demo page http://jqueryui.com/demos/sortable/#items My addition was a select element and checkbox for dynamically enabling or disabling the list item. The problem is: If I used the second method in the demo to cancel elements but keep them as drop targets, select elements inside sortable items become useless. There is no problem with the first method. It happens in chrome 16 and IE 8/9. Firefox 9 seems to be not affected by this bug.

Simply $( "#sortable1" ).sortable({

items: "li:not(.ui-state-disabled)"

}); works fine but $( "#sortable2" ).sortable({

cancel: ".ui-state-disabled"

}); somehow prevents select element from functioning.

See my demo page: http://www.1v1y.com/sorting.html

Change History (4)

comment:1 Changed 8 years ago by Scott González

Resolution: worksforme
Status: newclosed

You also want to cancel on :input, which is the default cancel value.

comment:2 in reply to:  1 Changed 8 years ago by cagdase

Replying to scott.gonzalez:

You also want to cancel on :input, which is the default cancel value.

$( "#sortable2" ).sortable({ cancel: ".ui-state-disabled,:input" }); fixes the problem. But there is still the question, why does FF behaves differently? Anyway, thank you.

comment:3 Changed 8 years ago by Scott González

Different browsers have different logic for selection/focus when preventing the default action in mousedown.

comment:4 Changed 7 years ago by yuceyazilim

I have implemented a sortable list according to the demo page http://jqueryui.com/demos/sortable/#items My addition was a select element and checkbox for dynamically enabling or disabling the list item. The problem is: If I used the second method in the demo to cancel elements but keep them as drop targets, select elements inside sortable items become useless. There is no problem with the first method. It happens in chrome 16 and IE 8/9. Firefox 9 seems to be not affected by this bug.

Simply $( "#sortable1" ).sortable({

items: "li:not(.ui-state-disabled)"

}); works fine but $( "#sortable2" ).sortable({

cancel: ".ui-state-disabled"

}); somehow prevents select element from functioning.

See my demo page: http://www.yuceyazilim.com.tr See my demo page: http://www.yedekparcaprogrami.com

Note: See TracTickets for help on using tickets.