-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Toolbar icons need accessible names #1349
Comments
Can you submit a PR for this? |
@wxcafe |
I can work on this if nobody else is! 🙂 |
Sure yeah! 😊
Clément 'wxcafé' Hertling
… On 9 Apr 2017, at 8:17 PM, Antonio Villagra De La Cruz ***@***.***> wrote:
I can work on this if nobody else is! 🙂
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I would recommend keeping the title attribute as well, since it was probably intended to make the interface more usable (at least for some mouse/trackpad users). <a title="Getting started" class="drawer__tab" href="/web/getting-started">
<i role="img" aria-label="Getting started" class="fa fa-fw fa-asterisk"></i>
</a> |
The problem with using When icons are used but their meaning is not clear they should be accompanied by text to provide a usable experience. Beyond the need for an accessible name, this is a design problem as much as a technical implementation problem. Note that the small screen size icon links do not have a title attribute but also lack an accessible name. |
I noticed this as well. Made a quick VoiceOver GIF showing the issue I'm with @fvsch on it is OK to keep <a title="Getting started" class="drawer__tab" href="/web/getting-started">
<i role="img" class="fa fa-fw fa-asterisk"></i>
<span class="visually-hidden">Getting started</span>
</a> http://a11yproject.com/posts/how-to-hide-content/ UPDATE |
It really isn't a good idea to use the title attribute in this context. This article on using the HTML title attribute (written by one of the editors of the HTML5 specification) explains why. The code suggested by @jpdevries has a few problems:
If you use If you visually hide the text inside the If you use the So taking @IanPouncey's comment into account, the best code to use would be:
|
Closes mastodon#1349 This is my first PR and I’m only checking in the source JSX file. Please let me know if it should be checked in after being built also.
Thanks @LJWatson! That is all really good to know. I submitted a PR that adds |
While there isn't enough room to display text next to the toolbar icons inline, what if we displayed the title of the active icon beneath the toolbar? Perhaps And maybe there could be a preference for whether or not to "Use Descriptive Buttons". |
@LJWatson What's your opinion on putting that |
@jessebeach An additional thought is that if there is visible text content inside the
|
As long as the |
I've just realised that these toolbar links control what's displayed in one of the columns... and only because someone sighted pointed it out. Should there be |
What behavior would that precipitate? Is it forward-looking AT support? |
It establishes a relationship between the controller (the link) and the thing being controlled (the column). Its useful when you can't appreciate that relationship visually. Jaws is the only screen reader with support at present (though hopefully others will follow suit). When focus moves to the control, Jaws indicates that it controls some content and provides a shortcut for navigating straight to the controlled content if you wish. |
Nice, I did not know this. Thank you for the clarification. |
The drawer tabs which control primary navigation are only labelled by a title which is not available to many screenreaders. Add an aria-label attribute to each link to improve readability with screenreaders. Organize link attributes so link target is first followed by classname. Issue mastodon#1349
Abstract aria roles such as section should not be used in content. Use non-abstract 'region' aria role instead. That role expects an aria-labelledby attribute with an id. Pass an ID to the column header. Remove the aria-label attribute on the ColumnHeader because the same value is output in plaintext as its child. Issue mastodon#1349
Columns do not have wrappers, so these icons can't point to a column wrapper which it controls. Instead these icons function as triggers to show or hide individual columns. mastodon#1349
Let me know if there are adjustments I could make to this PR. Details in the description. Thanks. ✌️ |
* feat(aria): Add aria-labels to underlabelled tab nav items The drawer tabs which control primary navigation are only labelled by a title which is not available to many screenreaders. Add an aria-label attribute to each link to improve readability with screenreaders. Organize link attributes so link target is first followed by classname. Issue #1349 * feat(aria): Replace abstract aria role of section with region Abstract aria roles such as section should not be used in content. Use non-abstract 'region' aria role instead. That role expects an aria-labelledby attribute with an id. Pass an ID to the column header. Remove the aria-label attribute on the ColumnHeader because the same value is output in plaintext as its child. Issue #1349 * fix(aria): Remove aria-controls attribute until solution is found Columns do not have wrappers, so these icons can't point to a column wrapper which it controls. Instead these icons function as triggers to show or hide individual columns. #1349 * fix(typo): Remove type of aria-labelledby instead of aria-label
@LJWatson @stephenburgess8 can we close this issue now that the PR has been merged? :) |
Closes #1349 This is my first PR and I’m only checking in the source JSX file. Please let me know if it should be checked in after being built also.
Closes mastodon#1349 This is my first PR and I’m only checking in the source JSX file. Please let me know if it should be checked in after being built also.
…2299) * feat(aria): Add aria-labels to underlabelled tab nav items The drawer tabs which control primary navigation are only labelled by a title which is not available to many screenreaders. Add an aria-label attribute to each link to improve readability with screenreaders. Organize link attributes so link target is first followed by classname. Issue mastodon#1349 * feat(aria): Replace abstract aria role of section with region Abstract aria roles such as section should not be used in content. Use non-abstract 'region' aria role instead. That role expects an aria-labelledby attribute with an id. Pass an ID to the column header. Remove the aria-label attribute on the ColumnHeader because the same value is output in plaintext as its child. Issue mastodon#1349 * fix(aria): Remove aria-controls attribute until solution is found Columns do not have wrappers, so these icons can't point to a column wrapper which it controls. Instead these icons function as triggers to show or hide individual columns. mastodon#1349 * fix(typo): Remove type of aria-labelledby instead of aria-label
Closes mastodon#1349 This is my first PR and I’m only checking in the source JSX file. Please let me know if it should be checked in after being built also.
The toolbar icons ("Getting started", "Local timeline", "Federated timeline", "Preferences", "Logout") do not have proper accessible names. For example:
This means that in some circumstances the purpose of the link is not being announced by screen readers. The problem is that the
<i>
element is the only content of the link, and it has no actual content for screen readers to use.Note: When using the tab key to navigate the links, the
title
attribute does provide the necessary information. However, thetitle
attribute should not be used in this context.The solution is to remove the title attribute (to avoid the previous problem, and to avoid duplication with the correct solution), and use ARIA to enable screen readers to recognise the
<i>
element. For example:The text was updated successfully, but these errors were encountered: