question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Certain types such as MouseEvent.button not defined

See original GitHub issue

I noticed some values for types such as MouseEvent.button are defined in Web API specs but are not defined in lib.dom.ts:

0: Main button pressed, usually the left button or the un-initialized state
1: Auxiliary button pressed, usually the wheel button or the middle button (if present)
2: Secondary button pressed, usually the right button
3: Fourth button, typically the Browser Back button
4: Fifth button, typically the Browser Forward button

If this is intentional, I’m wondering what the rationale is. (I could not find any similar issues or couldn’t find the right terms.)

terms: MouseEvent, button

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HolgerJeromincommented, Dec 7, 2021

They are not defined in the browsers (others like WebSocket.CLOSED are). So defining them would be an TypeScript only invention. I don’t think this would align to the mission of TypeScript.

0reactions
github-actions[bot]commented, Sep 18, 2022

Closing because @saschanaz is one of the code-owners of this repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MouseEvent.button - Web APIs | MDN
The MouseEvent.button read-only property indicates which button was pressed on the mouse to trigger the event.
Read more >
Property MouseEvent.button doesn't work on mouseover event
I noticed that if the function is triggered by a mousedown event the value changes according to the pressed button.
Read more >
How to Fix ReferenceError: Event is Not Defined in JavaScript
JavaScript's ReferenceError: Event is Not Defined occurs if the event parameter is not declared correctly when using an event handler.
Read more >
MouseEvent (Java Platform SE 7 ) - Oracle Help Center
If the mouse event type has not been enabled on the component, ... Some extra mouse buttons are added to extend the standard...
Read more >
UI Events - W3C
This specification defines several classes of conformance for ... Certain event targets (such as a link or button element) may have ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found