I'm somewhat new to typescript and try to add type definitions to all my methods while being as precise as possible.
When I click in Chrome a PointerEvent
is emitted. In Firefox a MouseEvent
is emitted.
I know that PointerEvent
extends MouseEvent
and according to https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#browser_compatibility Firefox also supports these.
MouseEvent
)This seems to be a bug in Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1675847
And in Safari too: https://bugs.webkit.org/show_bug.cgi?id=218665
According to the specs: https://www.w3.org/TR/uievents/#event-type-click
it's supposed to be a PointerEvent
So until these bugs are fixed just use MouseEvent
since PointerEvent
inherits from MouseEvent
(https://www.w3.org/TR/pointerevents3/#pointerevent-interface)