Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
svenhaag opened this issue Feb 21, 2017 · 2 comments

Comments

@svenhaag
Copy link

svenhaag commented Feb 21, 2017

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:

@patrickhlauke
Copy link
Member

  • Bootstrap 3 isn't being developed further at this point - but the same behavior is present in Bootstrap 4 http://v4-alpha.getbootstrap.com/components/collapse/
  • aria-hidden is not needed, as the flip between display:none and display:block has the same effect (things that are display:none'd are hidden from assistive technology, the same way that those with aria-hidden="true" are)
  • the fact that aria-expanded is set on the element that is expanded/collapsed is a valid bug. it doesn't do any harm, but it's certainly incorrect - it should only be the trigger element (the link or button that causes the expand/collapse) that has that attribute. i'll see if this can be fixed

@mdo
Copy link
Member

mdo commented Apr 9, 2017

Does anything need addressing here in v4 that might be a breaking change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants