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(md-tooltip): tooltip is not removed when parent is

See original GitHub issue

Consider a scenario where there’s a button inside a container. The button has a tooltip and on click it should set a variable to another value. Based on that value the container element is added / removed with ngIf. Simple example:

<div *ngIf="!hidden">
  <button
    md-button
    md-tooltip="Hide this button"
    tooltip-position="after"
    (click)="hidden = true">HIDE ME!</button>
</div>

After clicking the button the container div is removed, however, the tooltip remains still, no way to remove it.

Plunkr example.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ivovizcommented, Sep 20, 2016

It’s a bit hacky, but what I’m doing now is adding

MdTooltip.prototype.ngOnDestroy = function () {
    this._overlayRef.dispose();
    this._overlayRef = null;
};

to node_modules/@angular2-material/tooltip/tooltip.js (just put it after the ngOnInit prototype).

0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tooltip issue, MatTooltip not working in Angular
It was fixed when I added the Material theme CSS. Check the console to see if it has a warning. Try adding the...
Read more >
Tooltipster - The jQuery Tooltip Plugin - GitHub Pages
Tooltipster is a powerful, flexible jQuery plugin enabling you to easily create clean, HTML5 validated tooltips.
Read more >
react-md - Blog
This release focused on creating a new Menu API that should hopefully make menus easier to use along with some other new features....
Read more >
angular/material
@leosco The only issue I have with tooltips are this message : Text for the tooltip has not been provided. Please include text...
Read more >
Angular Material Tooltip: mat Tooltip example
To add a tooltip to a disabled button, we can add matTooltip to a parent element as shown below. <div matTooltip="You do not...
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