I am currently testing the accessibility of a mobile web app I developed and have encountered an issue with checkboxes while using TalkBack on Android or VoiceOver on iOS.
The problem arises from hiding the actual checkbox and presenting a styled label that mimics its behavior.
Below is a snippet of the CSS used to hide the checkbox:
.input-tick {
position: absolute;
left: -999em;
For the full HTML and CSS example, you can visit it on JSFiddle.
TalkBack and VoiceOver attempt to outline both the hidden checkbox and the label:
When trying to interact with the checkbox, the x and y coordinates of the click fall outside the label's boundary due to how VoiceOver and TalkBack operate. This results in the checkbox not getting checked.
Is there a way to modify VoiceOver and TalkBack so they only interact with the label? Are there any alternative solutions to address this issue?