-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.9, 6.10
-
None
-
-
e9da80042 (dev), 9db065a09 (6.10), 273e345d9 (6.9), 5299c2c42 (dev), 293032ab2 (dev), a91e02ad0 (dev)
Currently there is no explicit a11y role for a switch, only for a checkbox. This is a problem on Android as an a11y element cannot be marked as a "Switch", only "Checkbox".
Checkboxes and switches do serve similar purposes but carry a small semantic difference. Both show their (binary/ternary) state and a user can switch between their states. A checkbox is passive, like a checkbox in a form. Changing the state of a checkbox does not directly trigger an action. Changing the state of a switch can have immediate effect, like changing the theme from light to dark or revealing additional options.
From the Material guidelines (https://m3.material.io/components/switch/guidelines):
Use checkboxes to select multiple related options in a list.
Use radio buttons to select a single option in a list.
Use switches to select standalone or more verbose options in a list, like settings.
From Microsoft (https://learn.microsoft.com/en-us/windows/apps/design/controls/checkbox):
For a binary choice, the main difference between a check box and a toggle switch is that the check box is for status and the toggle switch is for action. You can delay committing a check box interaction (as part of a form submit, for example), while you should immediately commit a toggle switch interaction.
Not every guideline and standard agrees here, the W3C WAI does state that they are interchangeable (https://www.w3.org/WAI/ARIA/apg/patterns/switch/), but this point is still open for discussion: https://github.com/w3c/aria-practices/issues/2647
Nonetheless I think there needs to be a new role to differentiate a "Switch" from a "Checkbox" for platforms that handle the roles differently.
| For Gerrit Dashboard: QTBUG-139676 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 676370,1 | iOS: Fix a11y representation of RadioButton and CheckBox | tqtc/lts-6.8 | qt/tqtc-qtbase | Status: NEW | +2 | 0 |
| 672306,23 | a11y: Add Switch role | dev | qt/qtbase | Status: MERGED | +2 | 0 |
| 674643,5 | Consider new Switch role introduced in qtbase | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 674849,10 | iOS: Fix a11y representation of RadioButton and CheckBox | dev | qt/qtbase | Status: MERGED | +2 | 0 |
| 676046,2 | iOS: Fix a11y representation of RadioButton and CheckBox | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |
| 676068,2 | iOS: Fix a11y representation of RadioButton and CheckBox | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
| 679524,4 | wasm: a11y - Consider partially checked state of checkbox | dev | qt/qtbase | Status: MERGED | +2 | 0 |