-
Notifications
You must be signed in to change notification settings - Fork 402
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
base: main
Are you sure you want to change the base?
feat(a11y): add aria-keyshortcuts
to search button
#2365
Conversation
👷 Deploy request for docsearch pending review.Visit the deploys page to approve it
|
aria-keyshortcuts
to search button
There was a problem hiding this 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-keyshortcuts