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 {
304
304
this . _applyPosition ( fallback ! . position , fallback ! . originPoint ) ;
305
305
}
306
306
307
- detach ( ) {
307
+ detach ( ) : void {
308
308
this . _clearPanelClasses ( ) ;
309
309
this . _lastPosition = null ;
310
310
this . _previousPushAmount = null ;
311
311
this . _resizeSubscription . unsubscribe ( ) ;
312
312
}
313
313
314
314
/** Cleanup after the element gets destroyed. */
315
- dispose ( ) {
315
+ dispose ( ) : void {
316
316
if ( this . _isDisposed ) {
317
317
return ;
318
318
}
@@ -369,8 +369,9 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
369
369
* on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
370
370
* Scrollable must be an ancestor element of the strategy's origin element.
371
371
*/
372
- withScrollableContainers ( scrollables : CdkScrollable [ ] ) {
372
+ withScrollableContainers ( scrollables : CdkScrollable [ ] ) : this {
373
373
this . scrollables = scrollables ;
374
+ return this ;
374
375
}
375
376
376
377
/**
Original file line number Diff line number Diff line change @@ -339,17 +339,16 @@ export class MatTooltip implements OnDestroy {
339
339
return this . _overlayRef ;
340
340
}
341
341
342
+ const scrollableAncestors =
343
+ this . _scrollDispatcher . getAncestorScrollContainers ( this . _elementRef ) ;
344
+
342
345
// Create connected position strategy that listens for scroll events to reposition.
343
346
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 ) ;
353
352
354
353
strategy . positionChanges . pipe ( takeUntil ( this . _destroyed ) ) . subscribe ( change => {
355
354
if ( this . _tooltipInstance ) {
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export declare class FlexibleConnectedPositionStrategy implements PositionStrate
122
122
withLockedPosition ( isLocked ?: boolean ) : this;
123
123
withPositions ( positions : ConnectedPosition [ ] ) : this;
124
124
withPush ( canPush ?: boolean ) : this;
125
- withScrollableContainers ( scrollables : CdkScrollable [ ] ) : void ;
125
+ withScrollableContainers ( scrollables : CdkScrollable [ ] ) : this ;
126
126
withTransformOriginOn ( selector : string ) : this;
127
127
withViewportMargin ( margin : number ) : this;
128
128
}
You can’t perform that action at this time.
0 commit comments