Skip to content

Commit

Permalink
fix ignored "change" event on select elements in IE
Browse files Browse the repository at this point in the history
In IE, jQuery reuses the click event on select elements to emulate the
"change" event bubbling up.

As shown in http://jsbin.com/ekofa3/14 this breaks when we live-bind to
"click" on any other element in the page. In that case, the event is
processed in liveHandler() and liveFired is set.

Since the event object is reused, liveHandler sees event.liveFired and
ignores the "change" event.

This patch makes sure that when the click event is repurposed liveFired
is cleaned up.
  • Loading branch information
brainlock committed Mar 23, 2010
1 parent ba8938d commit cfe37f3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/event.js
Expand Up @@ -738,6 +738,7 @@ if ( !jQuery.support.changeBubbles ) {

if ( data != null || val ) {
e.type = "change";
e.liveFired = undefined;
return jQuery.event.trigger( e, arguments[1], elem );
}
};
Expand Down

0 comments on commit cfe37f3

Please sign in to comment.