While mobile testing out a demo website I’ve created I noticed that when you tap on either an image or one of the arrow buttons in the Gallery section (and other areas of the site), a blue highlight appears on the background of the area. Is there a way to disable this, at least for the lightbox gallery buttons?
Please see the following page for a demo (view on mobile - desktop does not appear to be affected).
Let me know if any other details would be helpful.
The blue highlight will be the default outline styles for elements that are focussed and are present in desktop as seen in the screenshot below. If you remove the highlight then keyboard users will be unable to tab through your page or use it at all.
I suggest that you set an outline style on focus that fits in with your colour scheme but I would not remove them as they are the greatest accessibility aid that you can have without doing any extra work.
Thanks Paul! Ah, I was actually referring to the blue highlight when an item is focused (I think it may only appear on mobile?). I couldn’t find any way of targeting this, however, in my initial searches - only the “user-select” property.
I guess a similar example is if you inspect an item using the Dev Tools and the blue overlay appears. My only thought is that it’s a bit off-putting when you tap on the left or right arrows when a gallery item goes full-screen as it “blinks” the selection of the parent element. Not something I’ve come across before.
Of course - actually, even better is a screen capture from my phone
This is running in Chrome on Android but I don’t think it would be device specific (possibly browser specific though?)
It could just be a characteristic of the browser and it’s unavoidable but just wondered if there was a way to at least reduce visibility of the blink by changing the colour or something.
I had a look I don’t think that is a browser thing. Looks to me like something to do with the lightbox thing. Have you had a look at dev tools on a mobile device to see if this is the case?
But this is not that issue. I can confirm I see the blue flash when I tested on Chrome on Android. So if I was you I would hook my phone up to computer and crack open dev tools and see.
Actually if I use the device toolbar in Chrome desktop it shows the highlight for ios (even though it shouldn’t as it doesn’t appear on the real device) and it looks like its some type of tap-highlight color.
I tried the fix below and it seemed to work in the inspector so might be worth a try.
Also on the device toolbar it seems that if you disable cursor:pointer then the highlight goes away.
If the first fix doesn’t work then it may be worth adding the following code to your page and see if it has any effect and it may bring you closer to a real solution.
Hey Paul (and mrlagmer), thanks for the tips!
I eventually plugged my Android phone in and found that indeed, it was the highlight color default on Chrome that was showing up. I disabled the cursor pointer and that immediately got rid of the issue, so I took Paul’s advice but instead targeted all elements and disabled the webkit highlight color like so:
*{
-webkit-tap-highlight-color: transparent;
}
Not ideal from an accessibility point of view I imagine so I guess I should just target elements within the body when the gallery pop-up is applied? It has also got rid of the annoying flash when you close the mobile menu, however, so I’m tempted to keep it as-is…
I’m always wary of removing things that are meant to aid the user but as it’s a non standard property I don’t think it will hurt too much to remove it and I couldn’t see it on my device anyway. Indeed the flash that you see may be more of a health issue to users with visual disturbance problems.
The above assumes that you have correct focus styles anyway so the tap highlight should mostly be redundant.