Bug Tracker

Modify

Ticket #9590 (closed bug: wontfix)

Opened 2 years ago

Last modified 14 months ago

IE7 / IE8 / IE9 bind() events order bug

Reported by: anonymous Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.6
Keywords: Cc:
Blocking: Blocked by:

Change History

comment:1 Changed 2 years ago by rwaldron

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to event

Copied from stackoverflow:

Here is sample:  http://jsfiddle.net/ewzHu/2/

<input id="testing" />

$('#testing').bind('change keydown',function(e){

$('body').append('<br />'+e.type);

}); Triggers two change events instead of one in IE only when ENTER button is pressed and does not triggers keydown.

If i change the order of bindings like that:

$('#testing').bind('keydown change',function(e){

$('body').append('<br />'+e.type);

}); Everything seems to be ok.


Could be a bug. I tested this in Firefox, Chrome, IE9, IE8, and IE7 and here are the results I got:

  • Firefox Fired: keydown, then a change.
  • Chrome Fired: keydown, then a change.
  • IE9 Fired: one Keydown Only
  • IE7/8 Fired: two changes

Gotta love browser inconsistencies! I try not to rely on things like this being in the same order. Another option is to wrap it, or fix it, to eat the unneeded event, if it's important.

comment:2 Changed 23 months ago by rwaldron

  • Status changed from open to closed
  • Resolution set to wontfix

There is no guarantee of order of events outside of key[down,up,press] and mouse[down,up,click]

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.