#14365 closed bug (notabug)
event.which passed to 'click' event is always 0 in IE8
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
According to the documentation, event.which
:
event.which
also normalizes button presses (mousedown and mouseupevents), reporting1
for left button,2
for middle, and3
for right. Useevent.which
instead ofevent.button
.
And yet I can't get jQuery 1.10.1 to return anything other than 0
. Am I missing a trick?
Change History (5)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
You quoted the docs yourself. The click event doesn't pass through the button information but mousedown/up does.
comment:3 Changed 10 years ago by
You're absolutely right, but is there a way I could petition for such information to be passed on to the click event? It really does seem pertinent.
comment:4 Changed 10 years ago by
The IE8 browser doesn't pass it to jQuery on a click event. If you need the info you could handle mousedown/up instead.
comment:5 Changed 10 years ago by
Thanks for the clarification.
For posterity (ie other people with my same problem coming across this), I'd like to take the opportunity to link a plugin I wrote to create leftclick
, rightclick
, middleclick
and anyclick
events which fire in the same circumstances as click
and can preventDefault
for the ensuing events, but which keep event.which
.
I say "1.10.1", but it applies to 1.10.2 back to 1.8.3.