Skip to content

2832 add aria labels to header elements#2834

Merged
howardchung merged 2 commits intoodota:masterfrom
micahchiang:2832-ally-updates-header
Oct 4, 2021
Merged

2832 add aria labels to header elements#2834
howardchung merged 2 commits intoodota:masterfrom
micahchiang:2832-ally-updates-header

Conversation

@micahchiang
Copy link
Contributor

@micahchiang micahchiang commented Oct 2, 2021

Description

This pull request is in reference to this open issue regarding accessibility improvements. Specifically this pull request adds aria labels to several key elements in the OpenDota web application header. It's important to note that this pull request doesn't have any visual impact on the existing UI. Comments are left on each update describing why it was necessary.

This pull request fixes 3 site-wide critical accessibility issues detected by aXe.

Existing critical issues Screen Shot 2021-09-30 at 9 05 18 PM
With fixes, 0 remaining critical issues Screen Shot 2021-10-02 at 10 11 53 AM

Edit: I've gone ahead and included several more updates in the sponsor and footer sections of the homepage, since they were simple to add.


const AppLogo = ({ size, strings, onClick }) => (
<StyledLink to="/" onClick={onClick}>
<StyledLink aria-label="Go to the Open Dota homepage" to="/" onClick={onClick}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to provide clarity to screen reader users. Currently because css is used to transform the text to uppercase, screen readers spell out the link as Less than, O-P-E-N-D-O-T-A backslash greater than. With this aria label screen readers will now provide more accurate context to users who utilize them.

VoiceOver Screen Shot 2021-10-02 at 10 22 48 AM

<form onSubmit={this.formSubmit} style={{ width: small ? '280px' : 'auto' }}>
<TextField
id="searchField"
aria-label={strings.search_title}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual users have the hint text to go off of, but because this field lacks an associated label, screen reader users currently only hear edit text blank. With this aria label screen reader users now have the same context visual users have.

Current Screen Shot 2021-10-02 at 10 24 51 AM
With fix Screen Shot 2021-10-02 at 9 43 08 AM

@micahchiang
Copy link
Contributor Author

Added updates to sponsor links and app download links.

Copy link
Contributor Author

@micahchiang micahchiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few more a11y updates that don't include any visual changes.

style={{ position: 'relative', left: '13px', top: '12px' }}
>
<img src="/assets/images/google_play_store.png" alt="" height="46px" />
<img src="/assets/images/google_play_store.png" alt="download the android app on google play store" height="46px" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional links should meet W3 accessibility standards by providing alt text that accurately describes what the link does.

Current behavior Screen Shot 2021-10-02 at 11 15 34 AM
With updated alt text Screen Shot 2021-10-02 at 11 20 54 AM

style={{ position: 'relative', left: '20px', top: '5px' }}
>
<img src="/assets/images/apple_app_store.png" alt="" height="31px" />
<img src="/assets/images/apple_app_store.png" alt="download the iOS app on the app store" height="31px" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional links should meet W3 accessibility standards by providing alt text that accurately describes what the link does.

Current behavior Screen Shot 2021-10-02 at 11 15 47 AM
With updated alt text Screen Shot 2021-10-02 at 11 21 07 AM

Comment on lines +179 to +182
<span id="app-description">{strings.app_description}</span>
{' - '}
{strings.app_powered_by}
<a href="http://steampowered.com" target="_blank" rel="noopener noreferrer">
<span id="app-powered-by">{strings.app_powered_by}</span>
<a href="http://steampowered.com" aria-describedby="app-description app-powered-by" target="_blank" rel="noopener noreferrer">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Links should include proper context for screen reader users. Visual users can see the description, but currently screen reader users only hear http://steampowered.com. Adding aria-describedby adds context for screen readers.

Comment on lines +23 to +31
<span id="bg-image-description">{strings.home_background_by}</span>
<a
href="//www.artstation.com/artist/mikeazevedo"
target="_blank"
rel="noopener noreferrer"
aria-describedby="bg-image-description"
aria-label="Mike Azevedo on artstation.com"
> Mike Azevedo
</a>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though screen reader users may not experience the background image the same way visual users do, because there is a focusable link to the artist's profile, more context should be provided as to why a screen reader is dictating the link to the user. Currently screen readers will only read Mike Azevedo, leaving it up to the user to try and understand the meaning of the link. Adding an aria-describedby provides a little more meaning to screen reader users.

@micahchiang
Copy link
Contributor Author

Screen Shot 2021-10-02 at 11 30 20 AM

I've fixed most of the "serious" issues that aXe has flagged on the home page. The remaining ones can be left in my opinion, as screen readers provide accurate context for those links:

  1. Github icon is announced as Source on Github
  2. Discord icon is announced as Chat on Discord
  3. Steam icon will include additional context with the aria-describedby addition above.

Comment on lines +45 to +52
<img src="/assets/images/vp-logo.png" alt="VP Game home" />
</a>
<a
href="https://www.openai.com/"
target="_blank"
rel="noopener noreferrer"
>
<img src="/assets/images/openai-logo.png" alt="" />
<img src="/assets/images/openai-logo.png" alt="Open AI home" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the alt text, screen readers will read off the href very quickly, which may be challenging for users with cognitive disabilities. Providing alt text that reads a little more semantically helps reduce cognitive overhead.

@howardchung
Copy link
Member

Thanks for improving accessibility for our users!

@howardchung howardchung merged commit 4d5585f into odota:master Oct 4, 2021
@micahchiang
Copy link
Contributor Author

No problem, the pleasure is mine. I'll continue to do a sweep through the different parts of the web application and submit additional PRs where fixes are warranted. I'll do my best to leave the existing UI unaffected.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants