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(a11y): add aria-keyshortcuts to search button #2365

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

Conversation

bvandercar-vt
Copy link
Contributor

Copy link

netlify bot commented Nov 19, 2024

👷 Deploy request for docsearch pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 6bcdd8c

@bvandercar-vt bvandercar-vt changed the title feat(a11y): add aria-keyshortcuts to search button feat(a11y): add aria-keyshortcuts to search button Nov 19, 2024
Copy link
Contributor

@dylantientcheu dylantientcheu left a comment

Choose a reason for hiding this comment

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

I left a minor question.

@@ -34,14 +34,17 @@ export const DocSearchButton = React.forwardRef<HTMLButtonElement, DocSearchButt
const [actionKeyReactsTo, actionKeyAltText, actionKeyChild] =
key === ACTION_KEY_DEFAULT
? // eslint-disable-next-line react/jsx-key -- false flag
([ACTION_KEY_DEFAULT, 'Ctrl', <ControlKeyIcon />] as const)
: (['Meta', 'Command', key] as const);
([ACTION_KEY_DEFAULT, 'Control', <ControlKeyIcon />] as const)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need this change? Ctrl -> Control ?
and 'Meta', 'Command', key -> 'Meta', 'Meta', key

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, Ctrl and Command aren't valid values for aria-keyshortcut: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-keyshortcuts

Control and Meta are.

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.

2 participants