Mouse Event listeners are not triggered for mouse4 and mouse5 buttons
Categories
(Core :: DOM: UI Events & Focus Handling, defect)
Tracking
()
People
(Reporter: patrickmzimmermann, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Steps to reproduce:
Create a mouse listener on a page or directly in the console, for example: window.addEventListener("mousedown", e => console.log(e))
Actual results:
event is triggered for left, right and middle mouse buttons, but it does not trigger for mouse 4 and mouse 5 (back and forward buttons)
Expected results:
The event should trigger with specific values as seen here: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button#value
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•2 years ago
|
| Comment hidden (metoo) |
| Comment hidden (advocacy) |
From my testing mouse6, 7, ... up to mouse11 also don't appear to be detected. While the w3 standard (https://w3c.github.io/uievents/#dom-mouseevent-button) only explicitly mentions five values that must be handled, it doesn't exclude the possibility of values above 4 being used (any value above 2 as well as values below 0 are stated as being usable). Indeed, MouseEvent.buttons represents a 16-bit field for simultaneous button states, implying that up to sixteen distinct mouse buttons could be supported.
Is the intended fix to this to support these higher buttons as well, or only up to the fifth?
Updated•6 months ago
|
Description
•