-
Notifications
You must be signed in to change notification settings - Fork 137
Description
ARIA 1.2 issue #681 and its PR #972 revisited all roles that supported aria-expanded, and then:
- removed support for aria-expanded from grouping/container roles (i.e. the controlled element)
- added support for aria-expanded to checkbox (and switch, which inherits from checkbox)
However, a couple of things fell through the cracks.
Part 1. menuitemcheckbox and menuitemradio should not support aria-expanded
Currently menuitemcheckbox and menuitemradio inherit aria-expanded from menuitem (and checkbox).
We all agreed earlier that menuitem needs to support aria-expanded in order to allow for submenus, but menuitemcheckbox and menuitemradio are leaf nodes in a menu, so aria-expanded should be prohibited on them.
Looking at #681 (comment) and #681 (comment), it seems pretty clear that we intended to make this happen for ARIA 1.2.
Part 2. maybe radio should support aria-expanded now that checkbox does
Neither #681 nor #972 mention radio, and so even though it was decided that checkbox should support aria-expanded, it's not clear whether radio was considered as well.
People are using disclosures on radios (with or without aria-expanded).
The gov.uk design system has a pattern with conditionally revealed content between radios (example), and they give this advice:
Using this component, you can add conditionally revealing content to stacked radios, so users only see content when it’s relevant to them.
For example, you could reveal an email address input only when a user chooses to be contacted by email.
PatternFly has this guideline:
Use progressive disclosure to hide and show fields based on the users’ selection. This approach keeps the workflow short and allows the user to focus on only the fields relevant to them. It also avoids using color to indicate whether or not a field is available, making it suitable for visually impaired users.
In addition to forms, I've seen this used in print dialogs: (all pages, current page, custom + textbox) and in the controls for charts or transaction lists (last 5 days, last month, last 6 months, custom + datepicker).
The gov.uk people did some testing of this with screen readers (because it was flagged by a validator), and they discovered that there is enough AT support for aria-expanded on radios that they decided to keep using it in their forms, given that user testing did not find it problematic. In fact, they had some feedback that indicated that it is helpful to have expanded/collapsed announced.
Looking at the gov.uk test results, I see that NVDA/FF, VO/Safari and VO/iOS Safari all announce expanded/collapsed. I have just verified these, so it looks like we have our 2 implementations.