Commit f6ec9d54 authored by Matt Curry's avatar Matt Curry Committed by jeresig

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

parent 28ce1597
...@@ -661,15 +661,15 @@ function testChange( e ) { ...@@ -661,15 +661,15 @@ function testChange( e ) {
data = jQuery.data( elem, "_change_data" ); data = jQuery.data( elem, "_change_data" );
val = getVal(elem); val = getVal(elem);
if ( val === data ) {
return;
}
// the current data will be also retrieved by beforeactivate // the current data will be also retrieved by beforeactivate
if ( e.type !== "focusout" || elem.type !== "radio" ) { if ( e.type !== "focusout" || elem.type !== "radio" ) {
jQuery.data( elem, "_change_data", val ); jQuery.data( elem, "_change_data", val );
} }
if ( data === undefined || val === data ) {
return;
}
if ( data != null || val ) { if ( data != null || val ) {
e.type = "change"; e.type = "change";
return jQuery.event.trigger( e, arguments[1], elem ); return jQuery.event.trigger( e, arguments[1], elem );
......
...@@ -21,6 +21,11 @@ ...@@ -21,6 +21,11 @@
<option value='two'>change me 2</option> <option value='two'>change me 2</option>
<option value='three'>change me 3</option> <option value='three'>change me 3</option>
</select> </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>
<td> <td>
<select class='mselect_test' multiple="multiple"> <select class='mselect_test' multiple="multiple">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment