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 Esc key support to dismiss tooltips #5147

Merged

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Jan 23, 2020

Closes #3615

Refs w3c/aria-practices#127 w3c/wcag#914 w3c/wcag#915

This PR adds Esc key support to dismiss all visible definition and icon tooltips. It appears that the pattern is still a work in progress on the w3c's end, so we will need to monitor the threads above to watch for any new changes or developments

Changelog

New

  • bx--tooltip--hidden class, applied for when the tooltip needs to be explicitly hidden (by esc key press)
  • event listeners for mouseenter and keydown events to correctly apply and remove the class depending on if a tooltip can/should be displayed

Testing / Reviewing

trigger a tooltip (or multiple tooltips) by hover and/or focus and dismiss them with Esc, ensure that tooltips are still usable as intended

@emyarod emyarod requested a review from a team as a code owner January 23, 2020 00:38
@ghost ghost requested review from aledavila and asudoh January 23, 2020 00:38
@netlify
Copy link

netlify bot commented Jan 23, 2020

Deploy preview for the-carbon-components ready!

Built with commit 6e66c13

https://deploy-preview-5147--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Jan 23, 2020

Deploy preview for carbon-elements ready!

Built with commit 6e66c13

https://deploy-preview-5147--carbon-elements.netlify.com

@netlify
Copy link

netlify bot commented Jan 23, 2020

Deploy preview for carbon-components-react failed.

Built with commit 6e66c13

https://app.netlify.com/sites/carbon-components-react/deploys/5e2f6c1b67651a000b4b0a43

@asudoh asudoh requested review from a team and designertyler and removed request for a team January 23, 2020 03:15
Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

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

Great to see the fix @emyarod!

@asudoh
Copy link
Contributor

asudoh commented Jan 24, 2020

Thank you for the updates @emyarod!

@emyarod emyarod force-pushed the 3615-definition-tooltip-dismiss-esc branch from 9ea4bd9 to ad2bf18 Compare January 27, 2020 15:40
@designertyler designertyler force-pushed the 3615-definition-tooltip-dismiss-esc branch from aab6ae7 to ad2bf18 Compare January 27, 2020 16:39
Copy link
Contributor

@designertyler designertyler left a comment

Choose a reason for hiding this comment

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

LGTM!

@asudoh asudoh merged commit f03a0a1 into carbon-design-system:master Jan 27, 2020
@emyarod emyarod deleted the 3615-definition-tooltip-dismiss-esc branch January 28, 2020 16:35
This was referenced Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Definition tooltip is not dismissable without moving focus
5 participants