-
Notifications
You must be signed in to change notification settings - Fork 330
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
Screen reader accessibility #1760
Screen reader accessibility #1760
Conversation
@@ -242,9 +242,16 @@ defmodule ExDoc.Formatter.HTML.TemplatesTest do | |||
tasks: [] | |||
}) | |||
|
|||
assert content =~ ~r{<li><a id="modules-list-link" href="#full-list">Modules</a></li>} | |||
refute content =~ ~r{<li><a id="exceptions-list" href="#full-list">Exceptions</a></li>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what this is about. I didn't see "exceptions" as a possible tab. It's not in SIDEBAR_NAV_TYPES
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a very old tab, it no longer exists. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove this assertion then
SIDEBAR_TAB_TYPES.forEach(type => { | ||
renderSidebarNodeList(getSidebarNodes(), type) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sidebar tabs were rewritten to have separate ul
elements for each tab. I was following https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tab_role#example as an example of a correctly implemented tab list, and each tab needs to have a different "tabpanel" component assigned to it. Hence multiple lists were necessary.
opacity: 1; | ||
color: var(--success); | ||
} | ||
.copy-button.clicked::after { | ||
content: "Copied! \2713"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the DOM so it can be inside an aria-live element
position: absolute; | ||
left: 0; | ||
top: 2px; | ||
content: "\25bc"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to the DOM so it can be hidden from screen readers
I'm not entirely sure if I tested all the possible variants of the components that I'm touching. I tested the "default" state you get with |
<% end %> | ||
</ul> | ||
</div> | ||
|
||
<ul id="full-list"></ul> | ||
</section> | ||
<ul id="extras-full-list" class="full-list" role="tabpanel" aria-labelledby="extras-list-tab-button"></ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTML validator says role tabpanel is not allowed on list, I need to wrap them in divs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will go ahead and merge this one, because some changes in this PR will unblock further work, but a follow up PR is welcome. :)
💚 💙 💜 💛 ❤️ |
Resolves #1756
Task list:
<nav>
,<main>
✅ c9d58cearia-controls
andaria-expanded
properties ✅ 132ccb2<p>
is not a valid child of<label>
✅ 17adec5aria-controls
andaria-expanded
properties. ✅ b65fe77aria-live
on the "copied!" text. ✅ 7be1ee0