Side navigation
#3861 closed bug (fixed)
Opened January 15, 2009 05:49AM UTC
Closed January 23, 2010 04:15PM UTC
Last modified March 09, 2012 06:46AM UTC
.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
Attachments (0)
Change History (11)
Changed January 15, 2009 01:40PM UTC by comment:1
component: | unfilled → event |
---|---|
milestone: | 1.3 → 1.3.1 |
resolution: | → worksforme |
status: | new → closed |
version: | 1.2.6 → 1.3 |
Changed January 15, 2009 08:53PM UTC by comment:2
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
Changed January 19, 2009 02:07PM UTC by comment:3
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.
Changed March 06, 2009 02:44AM UTC by comment:4
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
.livecatches 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.
Changed April 30, 2009 09:14PM UTC by comment:5
See also #4197 which was closed as duplicate of this bug
Changed November 08, 2009 11:31PM UTC by comment:6
I also posted a duplicate: http://dev.jquery.com/ticket/5461
Changed December 08, 2009 02:35PM UTC by comment:7
There are 2 tickets in bugzilla for Firefox and the click event getting fired on the document when you middle or right click.
Changed January 18, 2010 02:23AM UTC by comment:8
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?
Changed January 20, 2010 11:27PM UTC by comment:9
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.
Changed January 23, 2010 04:15PM UTC by comment:10
milestone: | 1.3.1 → 1.4.1 |
---|---|
resolution: | → fixed |
status: | reopened → closed |
version: | 1.3 → 1.4 |
Changed November 14, 2010 03:59AM UTC by comment:11
#5885 is a duplicate of this ticket.
Yep - that's to be expected. Any binding of a click handler will capture all clicks (not just left clicks).