简体   繁体   English

如何禁用Nexus Galaxy的画布高亮显示?

[英]How to disable highlighting of a canvas on tap for Nexus Galaxy?

I'm writing a web app that uses an HTML5 canvas and testing on a Nexus Galaxy. 我正在编写一个使用HTML5画布并在Nexus Galaxy上进行测试的Web应用程序。 When the user taps on the canvas, it highlights teal for a second, even though I am calling preventDefault() on the touchstart event. 当用户点击画布时,即使我在touchstart事件上调用preventDefault(),它也会突出显示青色。 I have also tried some CSS rules. 我也试过一些CSS规则。 How do I disable this brief highlighting? 如何禁用此简短突出显示?

Setting the CSS rule -webkit-tap-highlight-color to transparent on the canvas seemed to do the trick for me. 在画布上将CSS规则-webkit-tap-highlight-colortransparent似乎对我有用。

Note that I also did preventDefault and stopPropagation, so one of those might have had an effect too. 请注意,我也做过preventDefault和stopPropagation,因此其中一个也可能产生影响。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM