aboutsummaryrefslogtreecommitdiffstats
path: root/src/support.js
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-04-21 21:51:23 -0400
committerjeresig <jeresig@gmail.com>2011-04-21 21:51:23 -0400
commitd274b7b9f7727e8bccd6906d954e4dc790404d23 (patch)
treefb02a206c0e5206af9a546de8f2c2e744bda3bb3 /src/support.js
parent3ac9eb7ce37b461a34e303e8b77aa544d313441c (diff)
downloadjquery-d274b7b9f7727e8bccd6906d954e4dc790404d23.tar.gz
jquery-d274b7b9f7727e8bccd6906d954e4dc790404d23.zip
Landing pull request 332. Appending disconnected radio or checkbox inputs and keeping checked setting Fixes #8060, #8500.
More Details: - https://github.com/jquery/jquery/pull/332 - http://bugs.jquery.com/ticket/8060 - http://bugs.jquery.com/ticket/8500
Diffstat (limited to 'src/support.js')
-rw-r--r--src/support.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/support.js b/src/support.js
index b286907ff..8f2beebbc 100644
--- a/src/support.js
+++ b/src/support.js
@@ -186,6 +186,14 @@ jQuery.support = (function() {
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
div.innerHTML = "";
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM
+ input = document.createElement("input");
+ input.setAttribute("type", "checkbox");
+ input.checked = true;
+ div.appendChild( input );
+ support.appendChecked = input.checked;
+
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333