diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2013-01-16 00:14:57 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2015-08-10 10:26:13 -0400 |
commit | 9d820fbde6d89bc7a06e2704be61cf6c0b4d6e3c (patch) | |
tree | a4c2e3f31e8185cb910538488cd2d98ee251d97d /test/unit/event.js | |
parent | 9adfad19865837f5dffedb1eb41e407f196ca515 (diff) | |
download | jquery-9d820fbde6d89bc7a06e2704be61cf6c0b4d6e3c.tar.gz jquery-9d820fbde6d89bc7a06e2704be61cf6c0b4d6e3c.zip |
Event: Only check elements for delegation matches
Closes gh-2529
Ref trac-13208
(cherry picked from commit fc2ba2e1361126c39f955437ee025cfca3bffa65)
Diffstat (limited to 'test/unit/event.js')
-rw-r--r-- | test/unit/event.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 2e86eb78d..c53690abb 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1834,6 +1834,17 @@ test( "delegated event with selector matching Object.prototype property (#13203) equal( matched, 0, "Nothing matched 'toString'" ); }); +test( "delegated event with intermediate DOM manipulation (#13208)", function() { + expect(1); + + jQuery("#foo").on( "click", "[id=sap]", function() {}); + jQuery("#sap").on( "click", "[id=anchor2]", function() { + document.createDocumentFragment().appendChild( this.parentNode ); + ok( true, "Element removed" ); + }); + jQuery("#anchor2").trigger("click"); +}); + test("stopPropagation() stops directly-bound events on delegated target", function() { expect(1); |