-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(tooltip): reuse OverlayRef and portal #9637
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
* Reworks the tooltip to reuse the `OverlayRef` after the first time it is opened, rather than destroying it and creating a new one for every subsequent open. This reduces the overhead from having the create the new overlays all the time. * Changes the signature of the `ConnectedPositionStrategy.withScrollableContainers` method to return the position strategy. This is primarily for consistency with the other methods.
Caretaker note: there may be some tests that need an extra |
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.
LGTM
this._scrollDispatcher.getAncestorScrollContainers(this._elementRef) | ||
); | ||
|
||
strategy.onPositionChange.pipe(filter(() => !!this._tooltipInstance)).subscribe(change => { |
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.
!!
shouldn't be necessary here
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.
It is because filter
's predicate function is a (value: T, index: number) => boolean
.
Going to mark as major since it might affect unit tests |
* Reworks the tooltip to reuse the `OverlayRef` after the first time it is opened, rather than destroying it and creating a new one for every subsequent open. This reduces the overhead from having the create the new overlays all the time. * Changes the signature of the `ConnectedPositionStrategy.withScrollableContainers` method to return the position strategy. This is primarily for consistency with the other methods.
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. |
OverlayRef
after the first time it is opened, rather than destroying it and creating a new one for every subsequent open. This reduces the overhead from having the create new overlays all the time.ConnectedPositionStrategy.withScrollableContainers
method to return the position strategy. This is primarily for consistency with the other methods.