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

Add aria label to the customer account block link #46899

Merged
merged 2 commits into from Apr 29, 2024

Conversation

samueljseay
Copy link
Contributor

Changes proposed in this Pull Request:

As mentioned in #46754 there is no aria-label on the customer account when the setting is icon-only. It makes sense to add this to improve a11y in this situation.

Closes #46754 .

How to test the changes in this Pull Request:

  1. Add the customer account block to some content
  2. In the editor, set the block display style setting to "icon only"
  3. In the inspector in editor and front-end, confirm that an aria label is assigned to the link when it is display icon only
  4. Also ensure that the aria label is not displayed for other display modes.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Add aria-label to customer account block link when in icon-only display mode.

Comment

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Apr 25, 2024
@woocommercebot woocommercebot requested review from a team and imanish003 and removed request for a team April 25, 2024 05:22
Copy link
Contributor

Hi @imanish003,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

1 similar comment
Copy link
Contributor

Hi @imanish003,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

@imanish003 imanish003 left a comment

Choose a reason for hiding this comment

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

Hey @samueljseay,
I tested the changes & it's working as expected. Although, I have one quick question:
Would it be problematic if we added "aria-label" for all display styles? AFAIU We aren't adding it because there is following span in case of other display styles:

<span class="label">My Account</span>

But I don't think it will be problematic to have both i.e. this span & aria-label 🤔

@samueljseay
Copy link
Contributor Author

@imanish003

Yes it would be problematic to use for all display styles because it would override the actual text of the element to provide the label in screen readers. At worst its confusing if someone changes the text in future, at best its redundant.

Basically we should only provide it when there is no text available.

@samueljseay samueljseay reopened this Apr 26, 2024
@imanish003
Copy link
Contributor

@samueljseay That makes sense. Thanks for sharing your rationale behind it 🙌🏻

@samueljseay samueljseay merged commit 1e225f7 into trunk Apr 29, 2024
49 of 51 checks passed
@samueljseay samueljseay deleted the dev/fix-a11y-icon-only-customer-account-block branch April 29, 2024 01:35
@github-actions github-actions bot added this to the 9.0.0 milestone Apr 29, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Apr 29, 2024
@rodelgc rodelgc added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Improve customer account block a11y
3 participants