Skip to content

Commit

Permalink
Select (with a selected) fired change on first focus in IE. Fixes #5869.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Curry authored and jeresig committed Jan 23, 2010
1 parent 28ce159 commit f6ec9d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/event.js
Expand Up @@ -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";
Expand Down
5 changes: 5 additions & 0 deletions test/delegatetest.html
Expand Up @@ -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">
Expand Down

0 comments on commit f6ec9d5

Please sign in to comment.