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.

[Tooltip] Do not hide overlay while tooltip is hovered

See original GitHub issue

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

An option that allows not close tooltip when mouse hovers over tooltip. Something like: https://www.w3schools.com/css/tryit.asp?filename=trycss_tooltip

What is the current behavior?

The tooltip is immediately shown when the user’s mouse hovers over the element. The tooltip immediately hides when the user’s mouse leaves the element, it treats the tooltip area no difference with other area outside the element.

I understand that I can delay the hide time, but that is a different story.

What are the steps to reproduce?

Providing a Plunker (or similar) is the best way to get the team to see your issue. Doc site example: https://material.angular.io/components/component/tooltip

What is the use-case or motivation for changing an existing behavior?

As a web user, I found that on many websites, tooltips do not close when I mouse hover over them. This allows me to copy the text in the tooltip.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Material 2.0.0-beta.6

Is there anything else we should know?

If it doesn’t sound like a fair feature, is there a workaround I can use to achieve this? I tried

md-tooltip-component:hover {
  .mat-tooltip {
    visibility: visible;
  }
}

But it did not work

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:16
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
aardriancommented, Feb 1, 2022

The Basic tooltip in the docs as I see them today definitely has WCAG bugs:

  1. It fails WCAG 2.1 SC 1.4.13 Content on Hover or Focus, specifically:

Where receiving and then removing pointer hover or keyboard focus triggers additional content to become visible and then hidden, the following are true: […] Hoverable: If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing; […]

  1. The specific example fails WCAG 2.1 SC 2.5.3 Label in Name because the aria-label provides the accName for the control, overriding the visible text:
<button […] aria-label="Button that displays a tooltip when focused or hovered over" […]>
  <span class="mat-button-wrapper"> Action </span>
  […]
</button>

Obviously # 2 is less a concern because authors can “easily” fix that by not following the example in the docs.

The first issue is a genuine bug in the implementation. Which means every site that implements this tooltip component as-is is automatically failing that WCAG SC, and therefore WCAG as a whole. Which has all sorts of compliance and legal ramifications.

The issue was filed prior WCAG 2.1’s release with those SCs, but it was added in the August 2017 Working Draft and went live in June 2018. About 3⅔ years ago.

Since this now requires votes to fix this WCAG conformance bug, consider this comment as my vote, though I rather hope the “bug” label (or equivalent) gets added.

6reactions
manuelmeistercommented, Nov 22, 2021

This is requirement is not relevant to screen readers, but for accessibility. The section content-on-hover-or-focus.html#hoverable describes the requirement. You can see in the examples:


Screenshot of a button with a large mouse pointer over it, and a tooltip displayed  below the button which is obscured by the large pointer Screenshot of a button with a tooltip below it, and a large mouse pointer at the bottom of the tooltip

Figure 3 A button’s tooltip is displayed directly below it on mouse hover which can easily be obscured by a large pointer. The tooltip itself is able to be hovered so the mouse pointer can be moved down to its bottom edge in order to view the tooltip text.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery .tooltip() don't hide when hovering over tooltip?
It seems, when hovering out the tooltip itself, it hides. But hovering out of the . bar-lbl element, the tooltip stays visible, unless...
Read more >
Tooltip is not hiding once the hover over and mouse out is ...
I have implemented tool tip in my code and able to see it in the table when i hover over it. This is...
Read more >
Building a tooltip component - web.dev
A tooltip is a non-modal, non-blocking, non-interactive overlay containing supplemental information to user interfaces. It is hidden by default ...
Read more >
Tooltips - Material Design
Tooltips appear on hover, focus, or touch, and disappear after a short duration. Paired. Tooltips are always paired nearby the element with which...
Read more >
Tooltips - Bootstrap
Additionally, do not rely solely on hover as the trigger for your tooltip, as this will make your tooltips impossible to trigger for...
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