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.

bug(tooltip): Tooltips are sometimes empty

See original GitHub issue

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I am using MatToolTip and I encounter them often being empty like this:

Screen Shot 2022-01-26 at 10 29 17 AM

Each hover creates an additional empty bubble with an offset to the right. I can’t replicate this on Stackblitz yet.

My component looks like this:

foo.component.html

<div *ngIf="project">
   <button mat-icon-button type="button" matTooltip="XYZ">
      Hover me
   </button>
</div>

foo.component.ts

...
@Input() project: FooProject | null;
...

foo.component.scss

// Empty

I made two observations:

  1. Pressing a keyboard input like CTRL or ALT will update the view and show the correct tooltip.
  2. Removing *ngIf or setting it to true will result in a correct tooltip behaviour.

This is how the DOM looks like if the tooltip is empty:

<div class="cdk-overlay-container">
    <div class="cdk-overlay-connected-position-bounding-box" dir="ltr"
        style="top: 0px; left: 0px; height: 100%; width: 100%;">
        <div id="cdk-overlay-8" class="cdk-overlay-pane mat-tooltip-panel" style="top: 303px; left: 510.273px;">
            <mat-tooltip-component aria-hidden="true" class="ng-tns-c42-131">
                <div class="mat-tooltip ng-tns-c42-131 ng-trigger ng-trigger-state"></div>
            </mat-tooltip-component>
        </div>
    </div>
</div>

Reproduction

Steps to reproduce:

  1. Hover over the tooltip.

Expected Behavior

This is how it should look like.

Screen Shot 2022-01-26 at 10 32 07 AM

Actual Behavior

The tooltips are empty.

Environment

  • Angular: 11.2.13
  • CDK/Material: 11.2.13
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): MacOS, Windows, Linux

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
areksliwa-modentocommented, Jun 28, 2022

I have the same issue. I have a table with patients and after scrolling down, there are new rows rendered. And the issue with tooltip empty squares appears only on these newly rendered rows. After 700 delay tooltip with content appear correctly

@angular/cdk”: “^13.2.4”, “@angular/common”: “^13.2.4”, “@angular/compiler”: “^13.2.4”, “@angular/core”: “^13.2.4”, “@angular/forms”: “^13.2.4”, “@angular/material”: “^13.2.4”,

0reactions
sebastianrathcommented, Jul 1, 2022

I couldn’t find the cause on my side either, and I switched to popper.js with Angular bindings. It took me just a few minutes to replace 100 tooltips across my app.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Empty tooltip - Microsoft Community
When I hover my cursor over over something and the tooltip comes up it's always empty. This problem isn't just with third party...
Read more >
wrong (last or empty) tooltip text displayed for dropdown list ...
2. Click the dropmarker. Hover over one of the menuitems. The tooltip appears as well. That's the bug. 3. The right button is...
Read more >
Tooltip shows but is empty - BoomDevs
My tooltips show an empty box with no text in it. What do I need to do to fix that? https://prodogromania.de/alle-hunde/teddy/.
Read more >
SerializedProperty is empty with [Tooltip] attribute - Unity Forum
We had a bug report about our Localization property drawers not displaying tooltips, after investigation I discovered it was an issue for all ......
Read more >
Solved: Tooltip not show when it's empty
@dmoriau , I think that box, once you enable tooltip always comes. You can check and vote or log a new idea. -https://ideas.powerbi.com/ideas/....
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