Reputation: 1552
I made an accessible select component, following the ARIA guidelines. It is a combobox and uses aria-expanded
as prescribed to announce the state of the dropdown.
It works fine when the user first tabs into the component: screen readers announce the state (I tested VoiceOver/Safari and NVDA/Chrome). But on open, focus moves to an option and, since the combobox is not is focus, state is not announced.
I notice the same behavior on w3.org's own example
Is this expected behavior or should it be remediated? If so, how can it be done?
Upvotes: 2
Views: 2307
Reputation: 24825
With the pattern you are using this is expected behaviour from the small bit of functionality you described.
One thing to check though is that if I type an option that doesn't match, does it then switch state back to aria-expanded="false"
?
Also if you tab out of the control after writing a partial match and then tab back into it does it automatically expand the list to include matches and add aria-expanded="true"
?
If so then you have implemented it correctly as the expected behaviour is:
collapsed
is spoken.expanded
.collapsed
.That is why then aria-expanded
is needed on a combobox, it is for when you re-enter it so you know the state (or if the combobox is pre-populated it should auto expand then as well with aria-expanded="true"
!).
Upvotes: 1