Skip to main content

Search and Top Navigation

#4953 closed bug (worksforme)

Opened November 11, 2009 09:21PM UTC

Closed November 06, 2012 01:56AM UTC

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)
Change History (4)

Changed November 17, 2009 06:36PM UTC by jzaefferer comment:1

milestone: TBD1.8

Changed November 27, 2010 03:04PM UTC by gothick comment:2

_comment0: 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(). [http://stackoverflow.com/questions/4278753/jquery-ui-sortable-and-live-click-problem-need-to-click-twice-after-sorting description on stack overflow here] and [http://jsfiddle.net/U6sgM/4/ jsFiddle here].1291108114097493

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.

Changed October 11, 2012 02:54PM UTC by scottgonzalez comment:3

milestone: 1.9.02.0.0

Changed November 06, 2012 01:56AM UTC by mikesherov comment:4

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!