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

眉间皱痕 提交于 2019-12-07 13:40:08

问题


I'm writing a web app that uses an HTML5 canvas and testing on a Nexus Galaxy. When the user taps on the canvas, it highlights teal for a second, even though I am calling preventDefault() on the touchstart event. I have also tried some CSS rules. How do I disable this brief highlighting?


回答1:


Setting the CSS rule -webkit-tap-highlight-color to transparent on the canvas seemed to do the trick for me.

Note that I also did preventDefault and stopPropagation, so one of those might have had an effect too.



来源:https://stackoverflow.com/questions/9254252/how-to-disable-highlighting-of-a-canvas-on-tap-for-nexus-galaxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!