bug(tooltip): Tooltips are sometimes empty
See original GitHub issueIs 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:
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:
- Pressing a keyboard input like CTRL or ALT will update the view and show the correct tooltip.
- Removing
*ngIf
or setting it totrue
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:
- Hover over the tooltip.
Expected Behavior
This is how it should look like.
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:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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”,
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.