& # 39; ontouchstart& # 39;在msedge浏览器手机模拟器中,inwindow返回true,但

'ontouchstart' in window returns true in MS Edge browser phone emulator, but the touchstart event is not fired

本文关键字:inwindow true 返回 浏览器 ontouchstart msedge 手机 模拟器      更新时间:2023-09-26

当我在Microsoft Edge开发人员工具仿真选项卡中选择Windows Phone 10浏览器配置文件时,'ontouchstart' in window返回true,但没有触发touchstart事件。

这是一个bug吗?真正的Windows 10手机也有同样的表现吗?有办法在Edge上模仿touchstart吗?

注意:我知道pointerup事件,但我认为,如果只有pointerup被触发,'ontouchstart' in window应该是false

你在用鼠标吗?

我不知道Edge在使用Windows Phone 10浏览器配置文件时是否应该模拟触屏事件,但我猜它不会。笔记本电脑(现在)通常都有触摸屏,如果我没记错的话,这些触摸屏会在桌面Edge(还有IE)上产生触屏事件,所以微软可能已经决定,输入法(鼠标、触摸、笔)不应该被视为桌面/移动设备区别的一部分。

无论如何,如果你有一台有触摸屏的电脑,你可以用它来测试touchstart/touchend,但我不知道怎么做。