File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed
tools/public_api_guard/cdk Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -304,15 +304,15 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
304304 this . _applyPosition ( fallback ! . position , fallback ! . originPoint ) ;
305305 }
306306
307- detach ( ) {
307+ detach ( ) : void {
308308 this . _clearPanelClasses ( ) ;
309309 this . _lastPosition = null ;
310310 this . _previousPushAmount = null ;
311311 this . _resizeSubscription . unsubscribe ( ) ;
312312 }
313313
314314 /** Cleanup after the element gets destroyed. */
315- dispose ( ) {
315+ dispose ( ) : void {
316316 if ( this . _isDisposed ) {
317317 return ;
318318 }
@@ -369,8 +369,9 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
369369 * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
370370 * Scrollable must be an ancestor element of the strategy's origin element.
371371 */
372- withScrollableContainers ( scrollables : CdkScrollable [ ] ) {
372+ withScrollableContainers ( scrollables : CdkScrollable [ ] ) : this {
373373 this . scrollables = scrollables ;
374+ return this ;
374375 }
375376
376377 /**
Original file line number Diff line number Diff line change @@ -339,17 +339,16 @@ export class MatTooltip implements OnDestroy {
339339 return this . _overlayRef ;
340340 }
341341
342+ const scrollableAncestors =
343+ this . _scrollDispatcher . getAncestorScrollContainers ( this . _elementRef ) ;
344+
342345 // Create connected position strategy that listens for scroll events to reposition.
343346 const strategy = this . _overlay . position ( )
344- . flexibleConnectedTo ( this . _elementRef )
345- . withTransformOriginOn ( '.mat-tooltip' )
346- . withFlexibleDimensions ( false )
347- . withViewportMargin ( 8 ) ;
348-
349- const scrollableAncestors = this . _scrollDispatcher
350- . getAncestorScrollContainers ( this . _elementRef ) ;
351-
352- strategy . withScrollableContainers ( scrollableAncestors ) ;
347+ . flexibleConnectedTo ( this . _elementRef )
348+ . withTransformOriginOn ( '.mat-tooltip' )
349+ . withFlexibleDimensions ( false )
350+ . withViewportMargin ( 8 )
351+ . withScrollableContainers ( scrollableAncestors ) ;
353352
354353 strategy . positionChanges . pipe ( takeUntil ( this . _destroyed ) ) . subscribe ( change => {
355354 if ( this . _tooltipInstance ) {
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export declare class FlexibleConnectedPositionStrategy implements PositionStrate
122122 withLockedPosition ( isLocked ?: boolean ) : this;
123123 withPositions ( positions : ConnectedPosition [ ] ) : this;
124124 withPush ( canPush ?: boolean ) : this;
125- withScrollableContainers ( scrollables : CdkScrollable [ ] ) : void ;
125+ withScrollableContainers ( scrollables : CdkScrollable [ ] ) : this ;
126126 withTransformOriginOn ( selector : string ) : this;
127127 withViewportMargin ( margin : number ) : this;
128128}
You can’t perform that action at this time.
0 commit comments