Accordion Button missing ARIA
-
Hi! Out of all the Table of Contents plugins that I tested, yours was the most accessible, which is amazing!
The button to control the accordion is not accessible however and I’m hoping you can fix it. This is the current code:
<button type="button" class="simpletoc-collapsible">Table of Contents</button>
This button needs to keep the heading and to have aria-expanded and aria-controls attributes on it like this:
<h2><button type="button" class="simpletoc-collapsible" aria-expanded="false" aria-controls="simpletoc-content-container">Table of Contents</button></h2> <div class="simpletoc-content" id="simpletoc-content-container"></div>
Aria-expanded should turn to true when the TOC is opened. Aria-controls should reference the id of the content container. The H2 should still be present even when this is a button so that it shows in the heading list for screen reader users.
Here’s an example of an accessible accordion if that’s helpful to you.
Thank you so much for prioritizing these fixes as I would love to use it on the WordPress Accessibility Day website.
- The topic ‘Accordion Button missing ARIA’ is closed to new replies.