mirror of
https://github.com/jquery/jquery.git
synced 2026-02-07 03:55:17 -05:00
Fix #12127. IE9/10 checks fall off the box on clone. Close gh-873.
This commit is contained in:
committed by
Dave Methvin
parent
fffd23285a
commit
569d064fc9
@@ -455,9 +455,7 @@ function cloneFixAttributes( src, dest ) {
|
||||
// IE6-8 fails to persist the checked state of a cloned checkbox
|
||||
// or radio button. Worse, IE6-7 fail to give the cloned element
|
||||
// a checked appearance if the defaultChecked value isn't also set
|
||||
if ( src.checked ) {
|
||||
dest.defaultChecked = dest.checked = src.checked;
|
||||
}
|
||||
dest.defaultChecked = dest.checked = src.checked;
|
||||
|
||||
// IE6-7 get confused and end up setting the value of a cloned
|
||||
// checkbox/radio button to an empty string instead of "on"
|
||||
|
||||
@@ -15,7 +15,7 @@ jQuery.support = (function() {
|
||||
|
||||
// Preliminary tests
|
||||
div.setAttribute( "className", "t" );
|
||||
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
||||
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox' checked='checked'/>";
|
||||
|
||||
all = div.getElementsByTagName("*");
|
||||
a = div.getElementsByTagName("a")[ 0 ];
|
||||
@@ -96,8 +96,8 @@ jQuery.support = (function() {
|
||||
};
|
||||
|
||||
// Make sure checked status is properly cloned
|
||||
input.checked = true;
|
||||
support.noCloneChecked = input.cloneNode( true ).checked;
|
||||
input.checked = false;
|
||||
support.noCloneChecked = !input.cloneNode( true ).checked;
|
||||
|
||||
// Make sure that the options inside disabled selects aren't marked as disabled
|
||||
// (WebKit marks them as disabled)
|
||||
|
||||
Reference in New Issue
Block a user