Opened 9 years ago

Closed 6 years ago

#4953 closed bug (worksforme)

Sortable supressing first click after sort on IE

Reported by: sergiopereira Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.sortable Version: 1.7.2
Keywords: IE events tables Cc:
Blocked by: Blocking:

Description

See demo at: http://jsbin.com/eleba or http://sergiopereira.com/temp/sortable/jq-ui-sortable.html

<script>

$( function() {

$('.sortableRows').sortable();

$('.otherButton').live('click', function(){alert('live clicked');}); $('.otherButton').click(function(){alert('normal clicked');});

$('.sortableRows .selectButton').click(function(){alert('#1 - normal clicked');}); $('.sortableRows .selectButton').live('click', function(){alert('#2 - live clicked');});

$('table').click( function(evt){

if( $(evt.target).is('.selectButton')){

alert('#3 - normal click on parent table');

}

});

$('table').live('click', function(evt){

if( $(evt.target).is('.selectButton')){

alert('#4 - live click on parent table');

}

});

});

</script>

Open this page in IE (I tried on IE8)<br> Click any of the Select and the Otehr button and see they work.<br> Now drag one of the yellow table rows to change its position<br> Try clicking one of the Select buttons again: On the very first click only the handler #1 fires.

<table border=1>

<tbody class="sortableRows">

<tr style="background-color:#ff9;">

<td>row 1</td> <td><input type="button" class="selectButton" value="Select"></td>

</tr> <tr style="background-color:#ff9;">

<td>row 2</td> <td><input type="button" class="selectButton" value="Select"></td>

</tr>

</tbody>

</table>

Attachments (1)

jq-ui-sortable.html (1.6 KB) - added by sergiopereira 9 years ago.
Repro

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by sergiopereira

Attachment: jq-ui-sortable.html added

Repro

comment:1 Changed 9 years ago by Jörn Zaefferer

Milestone: TBD1.8

comment:2 Changed 8 years ago by gothick

I'm seeing what I'm guessing is the same problem manifesting in Firefox 3 and IE6; certainly I find the need to click twice after sorting if using live(), but only once if using click(). description on stack overflow here and jsFiddle here.

This doesn't seem to happen with a list using similar code, so it may be related specifically to tables.

Last edited 8 years ago by gothick (previous) (diff)

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

Milestone: 1.9.02.0.0

comment:4 Changed 6 years ago by mikesherov

Resolution: worksforme
Status: newclosed

Thanks for taking the time to contribute to the jQuery UI project! I can no longer reproduce the issue using the latest jQuery and jQuery UI. http://jsfiddle.net/auwW4/

If you can still reproduce it, please feel free to reply to this ticket with a test case showing the problem. Thanks!

Note: See TracTickets for help on using tickets.