Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(md-tooltip): tooltip is not removed when parent is #1111

Closed
ivoviz opened this issue Aug 24, 2016 · 5 comments · Fixed by #1470
Closed

bug(md-tooltip): tooltip is not removed when parent is #1111

ivoviz opened this issue Aug 24, 2016 · 5 comments · Fixed by #1470
Assignees
Labels
P2 The issue is important to a large percentage of users, with a workaround

Comments

@ivoviz
Copy link

ivoviz commented Aug 24, 2016

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.

@jelbourn jelbourn added the P2 The issue is important to a large percentage of users, with a workaround label Aug 31, 2016
@jelbourn jelbourn self-assigned this Aug 31, 2016
@lghinet
Copy link

lghinet commented Sep 20, 2016

hello
any workarounds ?

@ivoviz
Copy link
Author

ivoviz commented 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).

@gucheen
Copy link
Contributor

gucheen commented Sep 28, 2016

@ivoviz 's hack still works in alpha.9, after the changes of the module structure.
However, now need to edit the ~/node_modules/@angular/material/material.umd.js.

@tapas4java
Copy link

@jelbourn , Just wanted to know any plan to fix this issue soon?

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants