-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(tooltip): remove native event listener on component destroy #5144
fix(tooltip): remove native event listener on component destroy #5144
Conversation
Please merge ASAP: it is causing huge mem-leaks in my application so it makes the Chrome tab to crash in few minutes... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Just one minor comment
src/lib/tooltip/tooltip.ts
Outdated
() => this.show()); | ||
this._leaveListener = _renderer.listen(_elementRef.nativeElement, | ||
'mouseleave', | ||
() => this.hide()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer breaking at the higher syntactic level:
this._enterListener =
_renderer.listen(_elementRef.nativeElement, 'mouseenter', () => this.show());
this._leaveListener =
_renderer.listen(_elementRef.nativeElement, 'mouseleave', () => this.hide());
@jelbourn I've resolved the comment and rebased the commit |
@michastreppel please revert all of the formatting changes to the file |
@jelbourn Done |
Component should clean up events it has registered to. Closes #4499
@jelbourn @tinayuangao I've rebased this PR. |
@jelbourn Please merge this pr asap. The tooltips are causing major issues in my app. |
…lar#5144) * fix(tooltip): remove native event listener on component destroy Component should clean up events it has registered to. Closes angular#4499 * Break at higher syntactic level * Undo accidental formatting
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. |
Component should clean up events it has registered to.
Closes #4499