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.
- Why does chrome emit a different event than Firefox
- Which type should I use in my event listeners (probably
MouseEvent
) - and most importantly, how do I determine that if both show something different? (a.k.a is it safe to trust chrome or do I have to consult the documentation?)
dblclick
in W3C spec is part of MouseEvent, not PointerEvent.. – Nonperformance