#3861 closed bug (fixed)
.live('click', function) conflicts with mousedown event
Reported by: | walidaly | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4.1 |
Component: | event | Version: | 1.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
on the main tutorial example on http://docs.jquery.com/Events/live click with your middle mouse button or right click on the "P" element you will see same effect
Change History (11)
comment:1 Changed 14 years ago by
Component: | unfilled → event |
---|---|
Milestone: | 1.3 → 1.3.1 |
Resolution: | → worksforme |
Status: | new → closed |
Version: | 1.2.6 → 1.3 |
comment:2 Changed 14 years ago by
but then what's the different between 'mousedown' and 'click' event? is that a JavaScript problem or JQuery? Specially, using window.open() inside the 'click' binding will make Firefox popup blocker stop the event
comment:3 Changed 14 years ago by
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
this must be bug, because if I use "bind('click', ...)" it work only with left click and not with other mouse clicks like right or middle click.
comment:4 Changed 14 years ago by
It seems like Firefox does not fire a click event for the element on a right-click, although it fires a mousedown and mouseup. However, it *does* fire a click event on document! Since .live
catches events at the document level, it sees the click event for the element even though the element itself does not. If you use an event like mouseup, both the p element and the document will see the event.
I agree this seems like a bug, but if so it's a browser bug. Here's a recent article describing the situation.
comment:7 Changed 13 years ago by
There are 2 tickets in bugzilla for Firefox and the click event getting fired on the document when you middle or right click. https://bugzilla.mozilla.org/show_bug.cgi?id=503026 https://bugzilla.mozilla.org/show_bug.cgi?id=485980
comment:8 Changed 13 years ago by
Still happening on 1.4.
Also, I think worth to note that jQuery is supposed to circumvents cross browser issues. This in most cases means workaround IE problems. This time our beloved Firefox is at stake but, IMHO jQuery sould fix it anyway.
I've debugged, made a patch and test cases. Submited to my fork on github: http://github.com/irae/jquery/commit/e94b1e7c320b78580a3fac1afc2b6a3bee4dc140
Tested on Firefox 3.5.7, IE6 and Chrome (win XP).
With github, is it necessary to submit the patch here on the bugtracker?
comment:9 Changed 13 years ago by
I agree with iraebrasil. Might be Firefox's fault, and Firefox might fix it in a later version, but we can't count on all of our site visitors staying up-to-date with the latest browser. *cough* IE6, for example *cough* If it's adressed in a jQuery patch, that puts a solution in the hands of the developers, and we're good with that stuff.
comment:10 Changed 13 years ago by
Milestone: | 1.3.1 → 1.4.1 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Version: | 1.3 → 1.4 |
Yep - that's to be expected. Any binding of a click handler will capture all clicks (not just left clicks).