The Popover, Dialog, Select, Menu, NavigationMenu and Collapsible components set the aria-controls attribute even when they are in the closed state.
Expected behavior
An aria-controls attribute should only be set when the related element is available in the DOM. Therefore the presence of the attribute should follow the open state.
Reproducible example
Go to the official documentation for one of the components listed above (i.e.: the navigation menu)
Leave the component in the closed state and inspect the DOM, searching for the aria-controls attribute
Suggested solution
The presence of the attribute should follow the open state of the component.
Bug report
Current Behavior
The
Popover
,Dialog
,Select
,Menu
,NavigationMenu
andCollapsible
components set thearia-controls
attribute even when they are in the closed state.Expected behavior
An
aria-controls
attribute should only be set when the related element is available in the DOM. Therefore the presence of the attribute should follow theopen
state.Reproducible example
aria-controls
attributeSuggested solution
The presence of the attribute should follow the
open
state of the component.