aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/event.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-01-19 22:14:24 -0500
committerDave Methvin <dave.methvin@gmail.com>2012-01-19 22:14:24 -0500
commit8d9025ca50603e5404c6b50f7fa6c87046ee24c1 (patch)
tree7ee72835aee4e9df9db426f2a1158afb224b5002 /test/unit/event.js
parent2982abbb13454bd4bdf0299f1183fb0d8c02f02d (diff)
downloadjquery-8d9025ca50603e5404c6b50f7fa6c87046ee24c1.tar.gz
jquery-8d9025ca50603e5404c6b50f7fa6c87046ee24c1.zip
Fix #8165: Ignore events bubbling through disabled elements.
Although #6911 fixed the case where event.target was disabled, it missed the case where the target was a sub-element.
Diffstat (limited to 'test/unit/event.js')
-rw-r--r--test/unit/event.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index 0932ce816..4c1901664 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -1213,8 +1213,8 @@ test("Delegated events in SVG (#10791)", function() {
svg.remove();
});
-test("Delegated events in forms (#10844; #11145)", function() {
- expect(2);
+test("Delegated events in forms (#10844; #11145; #8165)", function() {
+ expect(3);
// Aliases names like "id" cause havoc
var form = jQuery(
@@ -1246,6 +1246,16 @@ test("Delegated events in forms (#10844; #11145)", function() {
.end()
.off("submit");
+ form
+ .append( '<button id="nestyDisabledBtn"><span>Zing</span></button>' )
+ .on( "click", "#nestyDisabledBtn", function() {
+ ok( true, "enabled/disabled button with nesty elements" );
+ })
+ .find( "span" ).trigger( "click" ).end() // yep
+ .find( "#nestyDisabledBtn" ).prop( "disabled", true ).end()
+ .find( "span" ).trigger( "click" ).end() // nope
+ .off( "click" );
+
form.remove();
});