-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(tooltip): leaking TooltipComponent references #9109
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
Conversation
This could be problematic for testing because the view container determines when change detection happens for the tooltip content. Without specifying that, doing Why does the view container retain the reference to the tooltip component after it has been destroyed? Is this something that could be fixed in core? |
I was under the impression that |
I'll get someone from the core team to take a look next week |
@crisbeto think you could make a minimal repro of the |
055e2b1
to
918bcc9
Compare
e2aa1f7
to
3456d63
Compare
@crisbeto let's try this in ivy and see if the behavior changes, maybe some further debugging in the framework |
3456d63
to
cdd80ed
Compare
Fixes references to each of the `TooltipComponent` instances (one per opened tooltip) created by `MatTooltip` not being cleaned up. The issue comes from the fact that we're passing in the `ViewContainerRef` which ends up retaining the references until it is destroyed. This is problematic, because the tooltip could be attached to a very long-lived view container (e.g. inside the app navigation).
cdd80ed
to
c449fba
Compare
I suspect this PR can be closed, Ivy seems to have resolved the issue of holding onto old references. See this comment for details: #10397 (comment) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes references to each of the
TooltipComponent
instances (one per opened tooltip) created byMatTooltip
not being cleaned up on close. The issue comes from the fact that we're passing in theViewContainerRef
which ends up retaining the references until it is destroyed, which is problematic, because the tooltip could be attached to a very long-lived view container (e.g. inside an app's navigation). In this case we can get away with not passing in the view container, because the tooltip component is internal and we manipulate it directly through the tooltip trigger anyway.