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

feat: add keybindingDescription exploration #5626

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshblack
Copy link
Member

@ericwbailey observed that in IconButton's that use a tooltip and a keybinding hint that the computed label was including extra information. This seems due to the fact that we're constructing the keybinding hint using aria-hidden but this is not respected when aria-labelledby or aria-describedby is used.

This PR is an exploration into what it would look like to add a way to provide an appropriate description through keybindingDescription but it would be worth seeing if we can make this work with KeybindingHint directly.

Changelog

New

Changed

  • Add conditional to when the loading describedby is provided in ButtonBase
  • Update Tooltip so that only the inner context is pointed to by aria-labelledby or aria-describedby
  • Add keybindingDescription to see what this would look like to provide an appropriate description for the keybindingHint

Removed

Copy link

changeset-bot bot commented Jan 30, 2025

⚠️ No Changeset found

Latest commit: 2fa118d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jan 30, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 104.56 KB (-0.01% 🔽)
packages/react/dist/browser.umd.js 105 KB (+0.11% 🔺)

@ericwbailey
Copy link
Contributor

A little more context, if it's helpful. This work is in response to https://github.com/github/accessibility/issues/8018, which was discovered with a usability testing session with TetraLogical.

There are two user-facing concerns we're trying to address:

  • The lack of a pause between the button's accessible name/action (ex: "Save") and its companion description (ex: "Control S").
  • Assistive technology will read glyphs literally, so content like will be announced as "Upwards White Arrow Commercial".

This work addresses those concerns by allowing for visually maintaining the design, while also providing a mechanism for an author to override the auto-generated string with something that makes more sense for a user to hear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants