Skip to content

Rethinking the usage of aria-expanded in collapsible body in favor of aria-hidden. #22041

@svenhaag

Description

@svenhaag

When pressing the button in the example test case:

<button
  data-toggle="collapse"
  data-target="#collapseExample"
  aria-expanded="false"
  aria-controls="collapseExample">
  Button with data-target
</button>
<div class="collapse" id="collapseExample">content</div>

the aria-expanded attribute is also added to the collapseExample DIV like:

<button
  data-toggle="collapse"
  data-target="#collapseExample"
  aria-expanded="true"
  aria-controls="collapseExample">
  Button with data-target
</button>
<div class="collapse" id="collapseExample" aria-expanded="true">content</div>

Instead, for the #collapseExample, it should be not rendered at all due to the data-target attribute
OR the aria-hidden attribute should be explicitly set in every case (expanded or not) according to:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions