我知道这是“设计使然”,但在 Web 应用程序尤其是 Polymer 中处理此问题的最佳实践是什么?
我使用 on-tap
,有时在 iOS 等平台上。点击几下即可触发任何事件。这会导致糟糕的用户体验,我们 Web 应用程序开发人员已经在与原生应用程序进行一场艰苦的战斗。
相关:
最佳答案
谢谢大家的帮助!这似乎已经为我解决了:
body {
-ms-touch-action: none;
touch-action: none
}
The CSS property touch-action allows you to control the default touch behavior of an element. In our examples, we use touch-action: none to prevent the browser from doing anything with a users’ touch, allowing us to intercept all of the touch events.
touch-action allows you to disable gestures implemented by a browser. For example, IE10+ supports a double-tap to zoom gesture. By setting a touch-action of pan-x | pan-y | manipulation you prevent the default double-tap behavior. This allows you to implement a double-tap gesture yourself. In the case of IE10+, it also eliminates the 300ms click delay.
关于javascript - 有时需要两次点击才能触发一个事件。我该如何解决这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28973421/