Open atmgrifter00 opened 7 months ago
Looks like there isn't a clear solution.
aria-controls
- This needs to be set on the combobox
(role) element, referring to the controlled listbox. The listbox element is part of the shadow DOM, so we need the combobox
element to also be in the shadow DOM.
aria-activedescendant
- This needs to be set on the combobox
(role) element, referring to the selected nimble-list-option
. List option elements are slotted from the light DOM, so we need the combobox
element to also be in the light DOM.
This conflict could be avoided using the IDL property ariaActiveDescendantElement
, which allows elements to be referenced directly instead of via ID. However, that property is currently only supported on Safari.
Note also that currently, when the select has the filter enabled, it is setting aria-controls
and aria-activedescendants
on the filter textbox
. This is probably incorrect for aria-controls
. As the aria-controls
doc states, "A combobox element has aria-controls
set to a value that refers to the element that serves as the popup." I think that should be the case even if there is a filter.
🐛 Bug Report
As discussed in this PR comment, the
Select's
template is currently setting itsaria-controls
andaria-activedescendant
attributes improperly in that it is attempting to use ids across the shadow DOM boundary.💻 Repro or Code Sample
Select template.
🤔 Expected Behavior
😯 Current Behavior
💁 Possible Solution
Follow the patterns outlined in the PR comment where an element inside the shadow root of the
Select
has therole
andaria-controls
andaria-activedescendant
attributes set on it. SeeCombobox
template as an example.🔦 Context
🌍 Your Environment