Skip to content

fix: a11y issue fixes #2917

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

fix: a11y issue fixes #2917

wants to merge 7 commits into from

Conversation

ruizajtruss
Copy link

@ruizajtruss ruizajtruss commented May 10, 2024

Summary

This PR provides small accessibility fixes for components that had accessibility violations in storybook

Related Issues or PRs

Issue #2736
Issue #2916
Issue #2809
Issue #2880

How To Test

Check each component in storybook, shouldn't have any violations present.

Copy link
Contributor

github-actions bot commented May 10, 2024

Warnings
⚠️ This PR does not include changes to storybook, even though it affects component code.

Generated by 🚫 dangerJS against 090611c

@ruizajtruss ruizajtruss changed the title Ruizaj a11y issue fixes Fix: a11y issue fixes May 10, 2024
@ruizajtruss ruizajtruss self-assigned this May 10, 2024
@ruizajtruss ruizajtruss changed the title Fix: a11y issue fixes fix: a11y issue fixes May 10, 2024
@ruizajtruss ruizajtruss marked this pull request as ready for review May 11, 2024 03:21
@ruizajtruss ruizajtruss requested a review from a team as a code owner May 11, 2024 03:21
@werdnanoslen
Copy link
Contributor

Thanks! Are any of these also in here?

Copy link
Contributor

@ajfarkas ajfarkas left a comment

Choose a reason for hiding this comment

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

I like what we're trying to do here, though I'm not sure we need any of these changes. aria-live="off" is more appropriate, but I would not expect the character count to change if the user is not focused on that element.

Should we close this?

@@ -44,6 +44,7 @@ export const SearchButton = ({
name={buttonText}
size={3}
aria-hidden={true}
aria-label="Magnifying glass search icon"
Copy link
Contributor

Choose a reason for hiding this comment

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

💣 chore: There's no need to label this icon, ‏because aria-hidden=true.

Detail:
This icon is hidden from screen readers because it is decorative. The button is already labeled with text, so adding the aria-label would cause AT to read, "Search. Magnifying glass search icon".
I find it helpful to aim for a minimum of text. For instance if I do want to label the Search icon, I would simply use "Search". The fact that it's a magnifying glass (or an icon) doesn't add anything for someone who can't see it.

@@ -62,6 +62,7 @@ const LanguageSelectorDropdown: React.FC<LanguageSelectorProps> = ({
<li className="usa-language__primary-item">
<LanguageSelectorButton
className={classes}
aria-controls="language-options"
Copy link
Contributor

Choose a reason for hiding this comment

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

💣 chore: ‏This is a duplicate property, we should remove it.

The ID of the controlled menu is passed as a const via the controls attribute on this component. It's preferable to use the const anyway, so that updating the menu ID does not require an additional update to the controls prop.

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.

4 participants