@@ -23,7 +23,12 @@ import {
2323} from '@angular/core' ;
2424import { Directionality } from '@angular/cdk/bidi' ;
2525import { ComponentPortal } from '@angular/cdk/portal' ;
26- import { Overlay , OverlayRef } from '@angular/cdk/overlay' ;
26+ import {
27+ createFlexibleConnectedPositionStrategy ,
28+ createOverlayRef ,
29+ createRepositionScrollStrategy ,
30+ OverlayRef ,
31+ } from '@angular/cdk/overlay' ;
2732import { CdkColumnDef , _CoalescedStyleScheduler } from '@angular/cdk/table' ;
2833import { merge , Subject } from 'rxjs' ;
2934import { distinctUntilChanged , filter , take , takeUntil } from 'rxjs/operators' ;
@@ -64,14 +69,14 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
6469 protected abstract readonly eventDispatcher : HeaderRowEventDispatcher ;
6570 protected abstract readonly injector : Injector ;
6671 protected abstract readonly ngZone : NgZone ;
67- protected abstract readonly overlay : Overlay ;
6872 protected abstract readonly resizeNotifier : ColumnResizeNotifierSource ;
6973 protected abstract readonly resizeStrategy : ResizeStrategy ;
7074 protected abstract readonly styleScheduler : _CoalescedStyleScheduler ;
7175 protected abstract readonly viewContainerRef : ViewContainerRef ;
7276 protected abstract readonly changeDetectorRef : ChangeDetectorRef ;
7377
7478 protected readonly columnSizeStore = inject ( ColumnSizeStore , { optional : true } ) ;
79+ private _injector = inject ( Injector ) ;
7580
7681 private _viewInitialized = false ;
7782 private _isDestroyed = false ;
@@ -146,9 +151,10 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
146151 // over both cells and extending it down the table as needed.
147152
148153 const isRtl = this . directionality . value === 'rtl' ;
149- const positionStrategy = this . overlay
150- . position ( )
151- . flexibleConnectedTo ( this . elementRef . nativeElement ! )
154+ const positionStrategy = createFlexibleConnectedPositionStrategy (
155+ this . _injector ,
156+ this . elementRef . nativeElement ! ,
157+ )
152158 . withFlexibleDimensions ( false )
153159 . withGrowAfterOpen ( false )
154160 . withPush ( false )
@@ -162,12 +168,12 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
162168 } ,
163169 ] ) ;
164170
165- return this . overlay . create ( {
171+ return createOverlayRef ( this . _injector , {
166172 // Always position the overlay based on left-indexed coordinates.
167173 direction : 'ltr' ,
168174 disposeOnNavigation : true ,
169175 positionStrategy,
170- scrollStrategy : this . overlay . scrollStrategies . reposition ( ) ,
176+ scrollStrategy : createRepositionScrollStrategy ( this . _injector ) ,
171177 width : '16px' ,
172178 } ) ;
173179 }
0 commit comments