-
Notifications
You must be signed in to change notification settings - Fork 333
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
The expanded/collapsed state of conditional reveals is not available to all assistive technologies #1972
Comments
Next steps:
|
The CMS Design System (for healthcare.gov) uses <div aria-live="polite" aria-relevant="additions text" aria-atomic="false">
<input class="ds-c-choice" id="checkbox_checkbox_choice_2" name="checkbox_choice" type="checkbox" value="b" checked="">
<label class="ds-c-label" for="checkbox_checkbox_choice_2">
<span class="">Checkbox B with checked children</span>
</label>
<div class="ds-c-choice__checkedChild">
<div class="ds-u-clearfix">
<label class="ds-c-label ds-u-margin-top--0" for="textfield_3" id="textfield_label_4">
<span class="">Child field</span>
</label>
<input class="ds-c-field" id="textfield_3" type="text" name="textfield_child">
</div>
</div>
</div> |
GitHub's Primer uses <form>
<div class="form-checkbox">
<label>
<input type="radio" name="hireme" />
Not available for hire
</label>
</div>
<div class="form-checkbox">
<label aria-live="polite">
<input type="radio" class="form-checkbox-details-trigger" name="hireme" />
Available for hire
<span class="form-checkbox-details text-normal">
<span class="d-block mb-1">Available hours per week</span>
<input type="text" name="" class="form-control input-contrast" size="3" />
<span class="text-small text-gray pl-2">hours per week</span>
</span>
</label>
</div>
</form> (Not sure how this affects the labelling of the revealed field?) |
Note that we previously 'ruled out' using It might be worth trying to think about making the role of the radio button clear and notifying when the visibility of the reveal changes as two separate problems? |
I've been doing some investigation into this issue, specifically on radio buttons. The ARIA SpecThe ARIA spec currently allows As such, if the conditional reveal (for radio buttons) were changed to match the ARIA spec, the In theory, screen readers would still have all the information they need to announce expanding and collapsing content whenever they think they should, and so I think it's arguable that this would meet the requirements of WCAG 2.1. What screen readers doHowever, obviously we're also interested in what screen readers actually announce, and possibly whether we can do stuff in code to help them behave in ways that we think are more useful. I've created some variations on the conditional reveal, and tested them in Voiceover on iOS (13.7), macOS (Mojave 10.14.6), and NDVA (2019.3.1, Windows 10). (I don't currently have access to JAWS, but I can install it and test later.) I've recorded videos for:
(Big disclaimer: I don't routinely use screen readers myself, so I could easily be missing obvious interactions to test.) There are 5 different actions I've found that make some or all screen readers announce information about expanded or collapsed content. I've tried to make sure the videos cover all of these actions (although some might be less useful for actual screen reader users than others):
In Voiceover on macOS and NVDA, I've recorded separate videos for navigating the page with the tab key, and with the "web rotor" (i.e. navigating the page using the screen reader's own keyboard commands). So... what do screen readers do?I've attempted to summarise the results in tables, but in short, in the screen readers tested:
I'm sorry for the wall of text, but hopefully this shows some of the possibilites and pitfalls. Please do point out any mistakes or omissions, I'm sure I've made a few. |
Thanks @paulwaitehomeoffice – that's really helpful. Out of interest, did you try a variation with an explicit role of Either way, it's interesting to note that the current draft of ARIA 1.2 removes support for I think there's a possibility that we're going to end up raising an issue against the ARIA spec making the case for extending |
@36degrees Aha! I did not try I also did not think to check the current draft of the spec. Looking at how, for example, iOS behaves, it's probably sensible of them to limit Please do feel free to use anything I've posted, however you like, if it's helpful. |
Reading through the reasoning for discounting @tvararu I have a hunch you played about with |
Looking at the behaviour of the two examples from CMS Design System and GitHub primer, both of which use For example, checking the 'Email' checkbox in the example from the Design System, Voiceover reads out:
I am not sure that this is really that helpful (and may actually cause more confusion than not doing anything), but it might be worth testing. We could definitely explore providing screen-reader only content that describes the change. However, we'd need to think carefully about how this as it would need localising and potentially customising depending on what exactly is being conditionally revealed. |
I was looking at splitting this issue into two, as it can sort of be thought of as two problems:
However, the issues ended up having mostly the same content with some minor differences. So I'm keeping this as one issue, but it does seem useful to be able to differentiate between those two 'aspects' of this problem. |
Testing with the list of assistive technology / browser combinations in the service manual (plus NVDA / Chrome and JAWS / IE as the next most popular desktop screen reader combinations according to the most recent WebAIM screen reader survey)
✅ Supports [1] Announces collapsed state on selection, but not on focus.
[3] Announces collapsed state on selection, but not on focus. Makes a contradictory announcement when doing so:
[4] Makes a confusing announcement when announcing the expanded state on a radio:
(You cannot de-select a radio button, so double tapping does not collapse the reveal) [5] Also tested with Android 7, which had no support. See full testing output. Show full testing outputCheckboxes
Radios
|
Looking at the results for Chrome 86, you can see in the accessibility properties in Chrome developer tools that Chrome exposes the expanded state for checkboxes but does not for radios: Based on the results we saw for for NVDA / Firefox and JAWS /IE 11, I'd expect that if Chrome was updated to expose the expanded state for radios then we'd see it working equivalently for radios in JAWS 2020 / Chrome and NVDA / Chrome as well. EDIT: The checkbox role is explicitly listed as supporting It looks like this is a result of the changes in the ARIA 1.2 working draft – see https://chromium-review.googlesource.com/c/chromium/src/+/1686724 which 'brings |
We’ve removed ‘(WCAG 2.1 4.1.2 Name, Role, Value)’ from this issue as part of removing conditional reveals from our accessibility statement. |
What
As part of an internal accessibility audit of GOV.UK, conditional reveals† was flagged as failing WCAG 4.1.2:
It was flagged as failing because:
We use
aria-expanded
on these controls, but that is technically invalid according to the spec, which only allowsaria-expanded
on certain roles. Some screen readers still announce the expanded state, but those that don’t have no reason to implement it because it’s against the spec. ARIA 1.2 (which is currently in draft) extends support of aria-expanded to checkboxes but not radios.The fact that
aria-expanded
is not valid is recorded as a separate but related issue (#979).As of September 2019, this is known to affect:
Update
As of June 2021, we removed conditional reveals from our accessibility statement.
† The page being audited uses the conditional reveals in an unusual way, as what’s being revealed is effectively contextual help (like a hint) that would help the user to make the right choice. Whereas the way we intend the component to be used is to reveal additional form controls that ‘follow on’ from the initial question. We think that revealing text in this way is 'worse' in terms of accessibility, so we have a separate issue to discourage users from using conditional reveals to reveal text (alphagov/govuk-design-system#1362)
The text was updated successfully, but these errors were encountered: