ST-*_*DDT 9 firefox google-chrome mouseevent typescript
我对打字稿有点陌生,并尝试将类型定义添加到我的所有方法中,同时尽可能精确。
当我在 Chrome 中单击时,PointerEvent会发出 a 。在 Firefox 中,MouseEvent会发出 a。我知道PointerEvent扩展MouseEvent并根据https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent#browser_compatibility Firefox 也支持这些。
MouseEvent)这似乎是 Firefox 中的一个错误:https://bugzilla.mozilla.org/show_bug.cgi ?id=1675847
在 Safari 中也是如此:https ://bugs.webkit.org/show_bug.cgi?id=218665
根据规范: https: //www.w3.org/TR/uievents/#event-type-click
它应该是PointerEvent
因此,在这些错误得到修复之前,只需使用MouseEvent因为PointerEvent继承自MouseEvent(https://www.w3.org/TR/pointerevents3/#pointerevent-interface)
| 归档时间: |
|
| 查看次数: |
679 次 |
| 最近记录: |