New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(checkbox): use a native input to fix a11y issues with axe and screen readers #22402
Conversation
Testing this on my iPhone with VoiceOver on the checkbox does not toggle on double-tap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on macOS 10.15.6 and found the following issues:
- Pressing "Enter" does not toggle the checkbox like it currently does on
master
. This is probably because usingbutton
gave us that interaction for free.
Tested with VoiceOver on iOS 14 and found no issues.
Tested with VoiceOver on macOS 10.15.6 and found the following issues:
- When selecting a checkbox on macOS, VoiceOver highlights a corner of the checkbox. On
master
it highlights the entire item:
branch | master |
---|---|
- VoiceOver reads "You are currently on a checkbox inside of a checkbox" where it previously read "You are currently on a button inside of a checkbox" when selecting a checkbox. I don't know which one is correct but saying "checkbox inside of a checkbox" sounds confusing.
branch | master |
---|---|
Tested with TalkBack on Android 7.0 and found the following issue:
- After double tapping to check the checkbox, Chrome no longer highlights the entire item:
branch | master |
---|---|
Initially, Chrome only highlights the checkbox and not the entire item, but this is consistent across the branch and
master
.
Tested with NVDA on Windows 10 and found the following issues:
-
Tabbing to a checkbox and pressing "Enter" dismisses the modal. This is likely the same underlying issue as the first issue listed in this comment.
-
NVDA always reads the checkbox state as "not checked" even if it is checked.
NVDA does not seem to read the checkbox state when toggling the checkbox with Space, but that seems to be consistent across the branch and
master
.
- don't announce checkbox as being inside of another checkbox - properly announce when checked - expand footprint so the selected box surrounds the label too
…een readers (ionic-team#22402) fixes ionic-team#21644 fixes ionic-team#20517 fixes ionic-team#17796
Dev build:
5.5.0-dev.202011111928.7c95d89
🚨 This dev build includes #22477 for testing of both at the same timeFixes #21644
Fixes #20517
Fixes #17796
If this ends up working well for Checkbox, this can also be used for the following issues:
How this updates a11y and screen readers
Axe
No longer throws errors for aria attributes or buttons without content
NVDA
Tested in Edge and Chrome, reads as:
Checkbox must be in a form to use space to select it with NVDA running, otherwise you need to press
Ins
+space
to enter forms mode, then you can use space to select.VoiceOver
On Mac:
checkbox inside of a checkbox
(this is a compromise we have to make in order for it to work properly in Safari)On iOS:
Properly selects checkbox item, double tap will uncheck or check checkbox, skips over disabled checkboxes entirely
Talkback