Skip to content

Conversation

amyleadem
Copy link
Contributor

@amyleadem amyleadem commented Aug 19, 2022

Summary

  1. Updated the aria-label in English versions of usa-banner. When read out on a screen reader, the statement "An official website of the United States government" can sound like "Unofficial website of the United States government". To minimize confusion, we updated the component's aria-label to instead read "Official website of the United States government".

  2. Added aria-hidden attribute to the flag icon in the banner component. The flag icon in the banner component is purely decorative and we can safely remove it from the screen reader readout.

Related issue

This PR addresses two issues related to the banner screen reader experience:
Closes #4419
Closes #4912

Preview link

Preview link: Banner component

Problem statement

  1. When read out on a screen reader, the statement "An official website of the United States government" can sound like "UNofficial website of the United States government". This introduces the risk of conveying a meaning opposite of what was intended.
  2. The flag icon in the banner component is purely decorative and there is no need to announce its presence to those using screen readers.

Solution

Updating the aria-label gives us the ability to reduce confusion for those using screen readers without creating inconsistency in the visual presentation. Additionally, updating the aria for the icons in this component creates a simpler, clearer readout for screen readers.

Note: I did not hide the lock icon from the readout because I ruled that it added important context: an explanation that "A lock" means a lock icon. However, I did clarify the readout from "Lock, a locked padlock, image" to "Locked padlock icon, image" (on VoiceOver). Flagging this because it could be determined that this icon is decorative as well.

Testing and review

This component was tested on:

  • VoiceOver on Safari, Chrome, Firefox, and Edge for Mac
  • VoiceOver Gestures in iOS safari

Please test on your available screen readers to confirm that the content is accessible and the experience is optimized.


Before opening this PR, make sure you’ve done whichever of these applies to you:

  • Confirm that this code follows the 18F Front End Coding Style Guide and Accessibility Guide.
  • Run git pull origin [base branch] to pull in the most recent updates from your base and check for merge conflicts. (Often, the base branch is develop).
  • Run npm test and confirm that all tests pass.

@amyleadem amyleadem changed the title USWDS - Banner: Update aria-label with clearer readout USWDS - Banner: Create clearer readout with aria Aug 22, 2022
@amyleadem amyleadem marked this pull request as ready for review August 23, 2022 17:31
@amyleadem amyleadem requested a review from mejiaj August 23, 2022 17:31
Copy link
Contributor

@mejiaj mejiaj left a comment

Choose a reason for hiding this comment

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

Just a question on described-by for the lock icon. Everything else looks good! Tested the new language in Voiceover on Chromium.

@@ -1,8 +1,8 @@
{% set lock %}
<span class="icon-lock">
<svg xmlns="http://www.w3.org/2000/svg" width="52" height="64" viewBox="0 0 52 64" class="usa-banner__lock-image" role="img" aria-labelledby="banner-lock-title banner-lock-description" focusable="false">
<svg xmlns="http://www.w3.org/2000/svg" width="52" height="64" viewBox="0 0 52 64" class="usa-banner__lock-image" role="img" aria-labelledby="banner-lock-description" focusable="false">
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be sure this used to be described by both the title banner-lock-title and banner-lock-description.

Is this change to only have it described by the description intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this was intentional. On VoiceOver, the readout was "A lock ( Lock Locked padlock", so I simplified it by removing the reference to the title. Now that you bring it up, it might be better to just move the description content into the title field and then reference that. Objections?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, just double-checking. Thanks!

@amyleadem amyleadem requested a review from thisisdano September 9, 2022 18:12
Copy link
Contributor

@thisisdano thisisdano left a comment

Choose a reason for hiding this comment

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

Good updates

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