I’m using AccessibleWeb to test accessibility in a form that includes a dropdown menu for selecting an item.
The aria-expanded attribute is set to false by default, changes to true when the menu opens, and returns to false after an item is selected and the menu closes. However, the scan tool indicates that this attribute is not allowed in that state.
“ARIA attribute is not allowed: aria-expanded=“false””
Why is it not permitted? The dropdown is not expanded; it has collapsed after selection.
The code structure is as follows (with actual IDs removed for simplicity):
<span role="combobox" id="id-bla-bla" tabindex="0" aria-haspopup="listbox" aria-expanded="false" aria-controls="bla-bla" aria-label="Label Text" class="class-bla-bla" aria-activedescendant="">Chosen Value</span>