Make sure non-left-click events don't bubble. Fixes #3861.
This commit is contained in:
parent
8eef3a4f2c
commit
150e44cdda
2 changed files with 13 additions and 1 deletions
|
@ -608,7 +608,7 @@ test("toggle(Function, Function, ...)", function() {
|
|||
});
|
||||
|
||||
test(".live()/.die()", function() {
|
||||
expect(61);
|
||||
expect(62);
|
||||
|
||||
var submit = 0, div = 0, livea = 0, liveb = 0;
|
||||
|
||||
|
@ -675,6 +675,13 @@ test(".live()/.die()", function() {
|
|||
equals( livea, 6, "stopPropagation Click on inner div" );
|
||||
equals( liveb, 3, "stopPropagation Click on inner div" );
|
||||
|
||||
// Make sure click events only fire with primary click
|
||||
var event = jQuery.Event("click");
|
||||
event.button = 1;
|
||||
jQuery("div#nothiddendiv").trigger(event);
|
||||
|
||||
equals( livea, 6, "live secondary click" );
|
||||
|
||||
jQuery("div#nothiddendivchild").die("click");
|
||||
jQuery("div#nothiddendiv").die("click");
|
||||
jQuery("div").die("click");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue