Skip to content
Permalink
Browse files

Restore optSelected hack still needed by IE9/10

  • Loading branch information
dmethvin committed Dec 31, 2012
1 parent 747dd8c commit f75c0627f22b4af52199b46659675258811970f5
Showing with 18 additions and 0 deletions.
  1. +14 −0 src/attributes.js
  2. +4 −0 src/support.js
@@ -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() {
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
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
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",

0 comments on commit f75c062

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