-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[core][a11y] Enable Escape key dismissal for Tooltips #7669
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
base: develop
Are you sure you want to change the base?
Conversation
Generate changelog in
|
Add functionality to allow Tooltips to be esc-key closedBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
mm-wang
left a comment
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.
Any chance we can get a test for multiple overlays?
| }); | ||
| }); | ||
|
|
||
| describe("keyboard interactions", () => { |
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.
question: Open to using React Testing Library for new tests?
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.
Sure! There aren't that many tests here in this suite, so I've opted to replace them all with RTL for consistency. 56a9874
8760d4d to
56a9874
Compare
Rewrite Tooltip tests with RTLBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Write test to verify closing multiple Tooltips with EscBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Fixes #7594
Summary
Adds Escape key support to dismiss Tooltips, bringing Blueprint into compliance with WCAG 2.1 Success Criterion 1.4.13 and the WAI-ARIA Tooltip Pattern.
Problem
Tooltips in Blueprint could not be dismissed using the Escape key, which violates:
Previous Behavior
canEscapeKeyClose={false}hardcodedautoFocus={false}to avoid stealing focus on hoverSolution
Added a document-level Escape key listener to Overlay2 that activates when
autoFocus={false}. Tooltip no longer hardcodescanEscapeKeyClose={false}, allowing it to inherit the defaulttruevalue from Overlay2 while keepingautoFocus={false}to prevent focus steal on hover.Testing
Escapekey