click event isn't firing on middle or right buttons clicking

RESOLVED INVALID

Status

()

Core
DOM: Events
RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: Simon Grim, Unassigned)

Tracking

47 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
Build ID: 20160220030407

Steps to reproduce:

`.addEventListener('click', function(e) {/*whatever*/})`, please see https://jsfiddle.net/n99r4ygo/


Actual results:

click event is firing only for left button of mouse


Expected results:

click event could be fired for all buttons of mouse
(Reporter)

Updated

2 years ago
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
(Reporter)

Comment 1

2 years ago
as side effect event default handling can't be prevented, see https://bugzilla.mozilla.org/show_bug.cgi?id=1249924

Updated

2 years ago
Component: Untriaged → DOM: Events
Product: Firefox → Core
Per spec middle/right clicks shouldn't be dispatched to the web page.
"Secondary buttons (like the middle or right button on a standard mouse) MUST NOT fire click events. "
IIRC Gecko has still a bug that if you add listener to window object, you might get them.


https://w3c.github.io/uievents/


If you want the behavior changed, please get the spec changed first.
Spec bugs can be filed https://github.com/w3c/uievents/issues/new

If the spec gets changed, feel free to reopen this bug or file a new Gecko bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID
(Reporter)

Comment 3

2 years ago
oh… many thanks.
You need to log in before you can comment on or make changes to this bug.