Description
@darnautov brought this issue to our attention with Kibana PR 154237.
The EuiAccordion allows users to add interactive content next to the expand/collapse button as a way to surface multiple controls. When we do this, axe-core is throwing an error because we have an aria-expanded="true | false" attribute on a non-button element.
I'd recommend we check the buttonElement prop against the accepted values and conditionally render the aria-expanded attribute on accordion.tsx#L377 only if the ButtonElement === 'button'.
WCAG guidance

Description
@darnautov brought this issue to our attention with Kibana PR 154237.
The
EuiAccordionallows users to add interactive content next to the expand/collapse button as a way to surface multiple controls. When we do this, axe-core is throwing an error because we have anaria-expanded="true | false"attribute on a non-button element.I'd recommend we check the
buttonElementprop against the accepted values and conditionally render thearia-expandedattribute on accordion.tsx#L377 only if theButtonElement === 'button'.WCAG guidance