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

Fix race condition causing dotcom axe check failures for icon button tooltips #2244

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

camertron
Copy link
Contributor

Authors: Please fill out this form carefully and completely.

Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.

What are you trying to accomplish?

A recent slack conversation mentioned a number of ActionBar tests are failing axe checks (see: https://github.com/github/github/actions/runs/6124963111/job/16626078441?pr=287857, internal only). The issue appears to be happening because the IconButtons used in the ActionBar do not have an aria-label or aria-labelledby attribute set when axe runs. I discovered these attributes are added in javascript, which may or may not have finished executing by the time axe inspects the page.

The solution in this PR is to render the aria-labelledby or aria-describedby attribute on the server side.

Integration

No changes necessary in production.

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

Accessibility

  • No new axe scan violation - This change does not introduce any new axe scan violations.

Merge checklist

  • Added/updated tests
    - [ ] Added/updated documentation
    - [ ] Added/updated previews (Lookbook)
    - [ ] Tested in Chrome
    - [ ] Tested in Firefox
    - [ ] Tested in Safari
    - [ ] Tested in Edge

@changeset-bot
Copy link

changeset-bot bot commented Sep 13, 2023

🦋 Changeset detected

Latest commit: 74579eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added ruby Pull requests that update Ruby code patch release labels Sep 13, 2023
@camertron camertron marked this pull request as ready for review September 13, 2023 19:37
@camertron camertron requested review from a team, keithamus and jonrohan and removed request for keithamus September 13, 2023 19:37
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏻

@camertron camertron merged commit 3c5fb3a into main Sep 13, 2023
29 checks passed
@camertron camertron deleted the ssr_tooltip_aria branch September 13, 2023 22:21
@camertron camertron temporarily deployed to preview September 13, 2023 22:21 — with GitHub Actions Inactive
@primer primer bot mentioned this pull request Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch release ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants