-
-
Notifications
You must be signed in to change notification settings - Fork 787
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
Radio controls component has accessibility issues #218
Comments
This is mostly solved by b4fc01e. The only outstanding issue I'm aware of is that VoiceOver is reading "1 of 1" instead of "1 of (total)". This Chromium bug is related, but I'm still exploring ways around it in the meantime. |
From the ticket:
Yeah, looks like they need to figure this out for shadow-DOM, however I'm not sure if they can fix it? It's a known issue in the accessibility community in general that we can't do associations across shadow boundaries. For example, a component such as a Listbox using |
Will this issue remain open until the Accessibility Object Model is ready? Other Web Components libraries are resorting to rendering form elements in the light DOM to work around these issues. |
I recall seeing some activity in a Chrome bug that implied a fix was being worked on. I don’t think we’ll need to wait for AOM to land. I’ll investigate more when I get back. |
This doesn't appear fixed in Canary. It's still announcing "1 of 1" whereas Safari announces "1 of 3" as expected. Still seems like a Chrome bug to me, and I'm reluctant to refactor everything or use light DOM hacks when most VoiceOver users seem to prefer Safari. |
Also, VoiceOver in Firefox will announce twice as many radio buttons. I think this is because the shadow DOM For now, I think there's a couple of solutions: (b) is taken from Adobe's Spectrum Web Components. I have found some issues with (b). For example, if you want to support
And so you wouldn't be able to do something like: <sl-radio role="radio">
<!-- #shadow-root -->
<span aria-describedby="hint" id="radio"></span>
<span id="label">Label</span>
<span id="hint">Hint</span>
<!-- -->
</sl-radio> because Perhaps you could work around this by only rendering the 'hint' in the light DOM, but it feels messy: <sl-radio aria-describedby="hint" role="radio">
<!-- #shadow-root -->
<span id="radio"></span>
<span id="label">Label</span>
<!-- -->
<span id="hint">Hint</span>
</sl-radio> So I am leaning towards rendering in the light DOM until the Accessibility Object Model is ready. |
Interestingly, Firefox + VoiceOver doesn't read the labels but it does announce twice as many radios. This also seems like a browser bug to me, but adding I'll try to look into this more soon. Thanks so much for the detailed info! |
I'm having the same problem using and , on chrome and firefox, voice over always reads 1 of 1, but in Safari it works well. |
The radio controls component has several accessibility issues. I thought it was easier to lump them all together for the single component rather than separate issues for each.
I threw together a test page https://stommepoes.nl/work/shoelace/shoelace_demo.html and, on Windows only, ran 2 screen readers (NVDA latest, JAWS 2019) on 3 browsers (Edge latest, Chrome latest, Firefox latest... as of 23 September 2020). I don't own any iThings or I would have run VoiceOver on Safari (this is the combination for MacOS that is preferred for testing) as well.
name
attribute. However, radio controls must be within aradiogroup
element (such as a<fieldset>
which has this role natively, or an element with a manually-addedradiogroup
ARIA role).<legend>
, which must be the first child of a<fieldset>
. With non-native elements, this might be an element with a uniqueid
, and the element with theradiogroup
role is named by havingaria-labelledby
pointing to thatid
.** A note about Firefox: I tested a native set of ungrouped and a native set of grouped radio controls, to see if it was the lack of grouping causing the Tab issue. In Firefox, the grouping (or lack thereof) seems to have no direct effect. Firefox seems to allow Tabbing to each radio so long as none of them are selected. Once a selection is made, the typical native keyboard behaviour occurs. Yet in the tested Shoelace version, while there appears to always be at least one pre-selected radio, even manually mouse-clicking or using Enter to select a particular control does not bring the required "1 Tab stop per radio group" behaviour on the Shoelace radios.
It is expected that
Desktop:
Note: Bug #215 is also applicable
The text was updated successfully, but these errors were encountered: