aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-06-26 20:36:00 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-06-27 11:54:04 -0400
commit94e744aec9d25bb64a3cb72c3b81dd95e94d3955 (patch)
tree79782f841e06b4796bd47e53bbb15099f6408203 /test/unit
parentad2221853f839c15305f539b7b373241dfb6d628 (diff)
downloadjquery-94e744aec9d25bb64a3cb72c3b81dd95e94d3955.tar.gz
jquery-94e744aec9d25bb64a3cb72c3b81dd95e94d3955.zip
Fix #11315. Selector for .on() is relative to delegateTarget.
This fixes a regresssion from 1.6.4. Be aware that nearly every place that this bug comes into play, the selector in use is incredibly inefficient.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/event.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index a6ee455fb..07da83260 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -2333,6 +2333,20 @@ test("jQuery.off using dispatched jQuery.Event", function() {
.remove();
});
+test( "delegated event with delegateTarget-relative selector (#)", function() {
+ expect(1);
+ var markup = jQuery( '<ul><li><ul id="u1"><li id="f1"></li></ul></li>' ).appendTo("body");
+
+ markup
+ .find("#u1")
+ .on( "click", "li:first", function() {
+ ok( this.id === "f1" , "first li under #u1 was clicked" );
+ })
+ .find("#f1").click().end()
+ .end()
+ .remove();
+});
+
test("stopPropagation() stops directly-bound events on delegated target", function() {
expect(1);