Commit f75c0627 authored by Dave Methvin's avatar Dave Methvin

Restore optSelected hack still needed by IE9/10

parent 747dd8c0
...@@ -478,3 +478,17 @@ jQuery.each([ "radio", "checkbox" ], function() { ...@@ -478,3 +478,17 @@ jQuery.each([ "radio", "checkbox" ], function() {
} }
}); });
}); });
// IE9/10 do not see a selected option inside an optgroup unless you access it
// Support: IE9, IE10
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent && parent.parentNode ) {
parent.parentNode.selectedIndex;
}
return null;
}
});
}
...@@ -47,6 +47,10 @@ jQuery.support = (function() { ...@@ -47,6 +47,10 @@ jQuery.support = (function() {
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
checkOn: !!input.value, checkOn: !!input.value,
// Must access the parent to make an option select properly
// Support: IE9, IE10
optSelected: opt.selected,
// Makes sure cloning an html5 element does not cause problems // Makes sure cloning an html5 element does not cause problems
// Where outerHTML is undefined, this still works // Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>", html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
......
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