adobe/spectrum-css

[Bug][a11y]: Accordion item should not have role="listitem"

Closed this issue · 0 comments

Description

Browsers expose elements using .spectrum-Accordion-item as having role="listitem" even when the element is not contained within a list.

Steps to reproduce

This is due to the css declaration at:

display: list-item;

Examples on https://opensource.adobe.com/spectrum-css/accordion.html#standard add role="presentation" to the div.spectrum-Accordion-item in order to work around the issue, but other libraries using Spectrum-CSS may fail to do so.

Expected behavior

.spectrum-Accordion-item should not require display: list-item and should be exposed by the browser to assistive technology as a listitem.

Screenshots

Environment

  • Spectrum CSS version: @spectrum-css/accordion@3.0.43

  • Browser(s) and OS(s):

Additional context

Identified as part of Spectrum Web Components Accessibility Audit: adobe/spectrum-web-components#3212