-
-
Notifications
You must be signed in to change notification settings - Fork 300
Description
The <VersionSelector> component used in the package code page is not accessible for screen readers.
The root of the problem is that ARIA role option shouldn’t nest interactive content (or really any semantic content). Its children are expected to be presentational.
The current incorrect structure is like this:
role=listboxrole=optionrole=buttonrole=link- (then a list of
role=optionshown when the button isaria-expanded=true)
ARIA doesn’t expect there to be anything past the role=option (i.e. the contents are meant to be used for its accessible name).
On Windows 11, NVDA (in Firefox and Edge) is able to focus the expand/collapse button and link and even trigger the buttons, however, it cannot trigger the link.
On macOS and iOS, VoiceOver both do not go further than the role=option widgets (and do nothing when activated).
We will need different semantics which I can research. I suspect it might be a multi-level list of expand/collapse buttons + links that is focus trapped while it’s open. A treeview could be another option, but that has some significant complexity to it and shouldn’t be used lightly. The README table of contents is also using role=listbox when it probably shouldn’t, so it would be good to unify on an approach (even if the components are styled different).
I could add some screen caps when I get a change to better demonstrate the issue.