-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(tooltip): add support for hoverable definition tooltip body #5323
feat(tooltip): add support for hoverable definition tooltip body #5323
Conversation
Deploy preview for carbon-elements ready! Built with commit e78642a |
Deploy preview for carbon-components-react ready! Built with commit e78642a https://deploy-preview-5323--carbon-components-react.netlify.com |
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.
LGTM 👍 - Thanks @emyarod!
185f31a
to
59249d0
Compare
} | ||
); | ||
const debounceTooltipVisible = debounce(() => setTooltipVisible(false), 100); |
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 to debounce the exit? Are there any timing windows that we should be hitting for delays? Curious when we'd use 100/300/etc 🤔
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.
the 100ms delay value is arbitrary but debouncing the exit is what resolves the original issue. afaik there is no guidance on the delay since the guidelines are still WIP w3c/aria-practices#127 w3c/aria-practices#128
ed84a6e
to
851fa31
Compare
Closes #3616
This PR adds support for hoverable definition tooltip body so that users can now select the text in the tooltip
Changelog
New
.bx--tooltip--visible
class which is applied and removed (debounced) based onmouseenter
,mouseleave
, and Esckeydown
eventsChanged
focus
event handler tofocusin
event so that tooltips are correctly restored after Esc keypress and subsequent focusRemoved
pointer-events: none
rulesTesting / Reviewing
Ensure that definition tooltip body content is now selectable