Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't disable tap highlight color on iPad app

I'm creating a web page that needs to be viewable on an iPad.

Everything's great, but every time I click something, there's this annoying black flash. I've tried quite a few solutions:

html {
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none;
    -webkit-touch-callout:none;
} 


<script type="text/javascript">
    document.documentElement.style.webkitTouchCallout = "none";
</script>

Even adding it to the element itself:

.viewCont {
    width: 1000px;
    height: 690px;
    position: absolute;
    background-repeat: no-repeat;
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none;
    -webkit-touch-callout:none;
}

It works when I view it in Safari on my iPad, but when I make it a standalone dashboard app, the flicker returns.

Anyone have an hints or advice?

like image 202
Adam Templeton Avatar asked Dec 05 '25 14:12

Adam Templeton


1 Answers

You have to applied this to all elements and not just to HTML tag. Try like this

html * {
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    -webkit-user-select: none;
    -webkit-touch-callout:none;
} 
like image 190
Diego ZoracKy Avatar answered Dec 07 '25 12:12

Diego ZoracKy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!