question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow tooltips to accept prop "interactive: true" so that tooltips can be hovered over without closing

See original GitHub issue

🚀 Feature request

Chakra UI tooltips currently close immediately the moment you move your mouse away from the component that the tooltip is attached to. With tippyjs (also built on top of poppy.js), you can pass the prop interactive: true to make tooltips stay open if you hover over them, only closing when you hover way from both the tooltip and the component.

🧱 Problem Statement / Justification

This should be added to Chakra UI because I want to continue to use the otherwise fantastic tooltip component, rather than important the tippyjs dependency and then have to rebuild the tooltip with the animations and placement options, just to get the interactive prop and have tooltips stay open on hover.

Additionally, the popover component is not a solution because it requires a click to open and close.

✅ Proposed solution or API

Here is a demo of the requested behavior for Chakra UI - https://atomiks.github.io/tippyjs/#interactivity Notice that you can hover over the tooltip without it closing.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
Andaristcommented, Sep 8, 2021

IMHO to deliver the best experience for users by default this should be a default - and not something that is hidden behind an option. Speaking as a user of the web - I find it often quite frustrating when tooltips are disappearing when I hover them.

1reaction
Andaristcommented, Nov 10, 2021
  1. Not sure what the difference is but it definitely closes for me: https://www.loom.com/share/fc009d801e2440409d253177bb7eb620
  2. yep, I’m aware of this rule but I’m not sure if text selection is “interactivity”. I see how it could be treated both ways so if you want to treat it as interactivity, then that is fine by me

However, I still believe that tooltip disappearing on hover is a problem. I think we can guide ourselves here with the “hoverable” success criterion from the WCAG document. It states that:

Hoverable: If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing;

It feels like if we meet this precondition (“If pointer hover can trigger the additional content”) then we should implement the mentioned required part (“the pointer can be moved over the additional content without the additional content disappearing”) to meet this success criterion.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tooltips · Bootstrap v5.0
Elements with the disabled attribute aren't interactive, meaning users cannot focus, hover, or click them to trigger a tooltip (or popover). As a...
Read more >
Create Views for Tooltips (Viz in Tooltip) - Tableau Help
When a user hovers over a mark, the tooltip displays relevant data and details from another visualization filtered to that mark. You can...
Read more >
ARIA: tooltip role - Accessibility - MDN Web Docs - Mozilla
A tooltip is a contextual text bubble that displays a description for an element that appears on pointer hover or keyboard focus.
Read more >
Tooltip | Components - BootstrapVue
Tooltips can be triggered (opened/closed) via any combination of click , hover and focus . The default trigger is hover focus . Or...
Read more >
Building a simple tooltip component that never goes off screen
We can easily build a tooltip for desktop screens using the :hover pseudo-class. The drawback with this approach is that we need a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found