Skip to content
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

Remove the aria-label from the site title block #38432

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

carolinan
Copy link
Contributor

@carolinan carolinan commented Feb 2, 2022

Description

An aria-label is added to the site title when the "Make title link to home" and the "open in new tab" options are enabled.
The purpose is to announce to screen readers that the link opens in a new tab.

The problem is that only the message "opens in a new tab" is announced to screen readers, because the aria-label replaces the link text.

There are many past discussions about the underlying problem, but I was not aware of them when I added the aria-label to the block. It is clear from these past discussions that the aria-label, even if it would include the site title in the label, is not the correct solution.
This pr removes the aria-label and restores the link text.

Testing Instructions

  1. Apply the PR
  2. Create a new post or page
  3. Add a site title block. Enable both link settings.
  4. Save, and view the front.
  5. View source and confirm that the aria-label is not present for the site title link.
  6. Optionally activate a screen reader and confirm that the link text is correct.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

@carolinan carolinan requested a review from ajitbohra as a code owner February 2, 2022 06:46
@carolinan carolinan requested a review from aristath February 2, 2022 06:46
@carolinan carolinan added the [Block] Site Title Affects the Site Title Block label Feb 2, 2022
@carolinan carolinan merged commit 69c882a into trunk Feb 2, 2022
@carolinan carolinan deleted the update/site-title-remove-aria-label branch February 2, 2022 07:42
@github-actions github-actions bot added this to the Gutenberg 12.6 milestone Feb 2, 2022
@fabiankaegy
Copy link
Member

This got cherry picked into the Gutenberg 12.5 release with this commit: d128390

@carolinan carolinan added Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release [a11y] Labelling labels Feb 7, 2022
@Mamaduka
Copy link
Member

Backported to WP minor.

@Mamaduka Mamaduka removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Feb 16, 2022
@priethor priethor added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed [a11y] Labelling labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Site Title Affects the Site Title Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants