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

This commit is contained in:
Matt Curry 2010-01-23 12:52:32 -05:00 committed by jeresig
parent 28ce15979f
commit f6ec9d54d1
2 changed files with 9 additions and 4 deletions

View file

@ -661,15 +661,15 @@ 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";
return jQuery.event.trigger( e, arguments[1], elem );

View file

@ -21,6 +21,11 @@
<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">