Skip to content

[EuiAccordion] Should we really be using role="region"? #7316

@cee-chen

Description

@cee-chen

Totally not sure if I'm way off here, feel free to close this issue if so!

We're currently applying role="region" onto all accordion children:

I know that W3's WAI accordion example uses role="region", but based on what I'm reading from MDN's docs I'm skeptical that this should be the case for EUI's accordions. Specifically:

The region role is used to identify document areas the author deems significant
[...]
Use sparingly! Landmark roles are intended to be used sparingly, to identify larger overall sections of the document. Using too many landmark roles can create "noise" in screen readers, making it difficult to understand the overall layout of the page.

I really don't feel like we can say we know enough about the content in our accordions to deem them "significant", and in particularly for our collapsible nav that reuses multiple accordions which contain nothing but links, region makes no sense for those usages.

I'd like to propose switching to a role="group" by default and allowing consumers to override/set this role themselves if they know their own content well enough.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions