Skip to content
Permalink
Browse files

Select (with a selected) fired change on first focus in IE. Fixes #5869.

  • Loading branch information
Matt Curry authored and jeresig committed Jan 23, 2010
1 parent 28ce159 commit f6ec9d54d11432b91577addab6e613fb1f7a5203
Showing with 9 additions and 4 deletions.
  1. +4 −4 src/event.js
  2. +5 −0 test/delegatetest.html
@@ -661,14 +661,14 @@ function testChange( e ) {
data = jQuery.data( elem, "_change_data" );
val = getVal(elem);

if ( val === data ) {
return;
}

// the current data will be also retrieved by beforeactivate
if ( e.type !== "focusout" || elem.type !== "radio" ) {
jQuery.data( elem, "_change_data", val );
}

if ( data === undefined || val === data ) {
return;
}

if ( data != null || val ) {
e.type = "change";
@@ -21,6 +21,11 @@ <h2>Change Tests</h2>
<option value='two'>change me 2</option>
<option value='three'>change me 3</option>
</select>
<select class='select_test'>
<option value='one'>change me 1</option>
<option value='two' selected="selected">change me 2</option>
<option value='three'>change me 3</option>
</select>
</td>
<td>
<select class='mselect_test' multiple="multiple">

0 comments on commit f6ec9d5

Please sign in to comment.
You can’t perform that action at this time.