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

Only sets aria-labelledby to button label node only if loading is true #4450

Closed
wants to merge 4 commits into from

Conversation

mperrotti
Copy link
Contributor

Changelog

New

N/A

Changed

Button and IconButton only use aria-labelledby to preserve the button label in a loading state OR if aria-labelledBy was explicitly passed.

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

  • Added/updated tests
  • [N/A] Added/updated documentation
  • [N/A] Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge
  • (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)

@mperrotti mperrotti requested a review from a team as a code owner March 28, 2024 18:19
@mperrotti mperrotti requested a review from jonrohan March 28, 2024 18:19
Copy link

changeset-bot bot commented Mar 28, 2024

🦋 Changeset detected

Latest commit: d645b29

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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

Copy link
Contributor

github-actions bot commented Mar 28, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 89.03 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js 89.27 KB (-0.02% 🔽)

@github-actions github-actions bot temporarily deployed to storybook-preview-4450 March 28, 2024 18:23 Inactive
Copy link
Member

@joshblack joshblack left a comment

Choose a reason for hiding this comment

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

LGTM, will defer to @TylerJDev 👀

Random question, if we are both loading and aria-labelledby is passed as a prop should we have both or is it okay to just have the id for the container with the loading label?

Copy link
Contributor

@TylerJDev TylerJDev 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! 🎉

Random question, if we are both loading and aria-labelledby is passed as a prop should we have both or is it okay to just have the id for the container with the loading label?

Part of me feels like it should defer to the prop aria-labelledby if one is available. I'm thinking of icon buttons which don't contain any text content, but are linked to text via aria-labelledby. An example of this could be the loading state of IconButton, but if it contained a label that it linked with aria-labelledby.

@mperrotti
Copy link
Contributor Author

Closing this because I'm moving these changes over to a different PR: #4485

@mperrotti mperrotti closed this Apr 10, 2024
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.

3 participants