@@ -30,7 +30,7 @@ import {
3030 CdkConnectedOverlay ,
3131 CdkOverlayOrigin ,
3232 ConnectedPosition ,
33- Overlay ,
33+ createRepositionScrollStrategy ,
3434 ScrollStrategy ,
3535} from '@angular/cdk/overlay' ;
3636import { ViewportRuler } from '@angular/cdk/scrolling' ;
@@ -60,6 +60,7 @@ import {
6060 ViewEncapsulation ,
6161 HostAttributeToken ,
6262 Renderer2 ,
63+ Injector ,
6364} from '@angular/core' ;
6465import {
6566 AbstractControl ,
@@ -97,8 +98,8 @@ export const MAT_SELECT_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrateg
9798 {
9899 providedIn : 'root' ,
99100 factory : ( ) => {
100- const overlay = inject ( Overlay ) ;
101- return ( ) => overlay . scrollStrategies . reposition ( ) ;
101+ const injector = inject ( Injector ) ;
102+ return ( ) => createRepositionScrollStrategy ( injector ) ;
102103 } ,
103104 } ,
104105) ;
@@ -109,9 +110,10 @@ export const MAT_SELECT_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrateg
109110 * @breaking -change 21.0.0
110111 */
111112export function MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY (
112- overlay : Overlay ,
113+ _overlay : unknown ,
113114) : ( ) => ScrollStrategy {
114- return ( ) => overlay . scrollStrategies . reposition ( ) ;
115+ const injector = inject ( Injector ) ;
116+ return ( ) => createRepositionScrollStrategy ( injector ) ;
115117}
116118
117119/** Object that can be used to configure the default options for the select module. */
@@ -151,7 +153,7 @@ export const MAT_SELECT_CONFIG = new InjectionToken<MatSelectConfig>('MAT_SELECT
151153 */
152154export const MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {
153155 provide : MAT_SELECT_SCROLL_STRATEGY ,
154- deps : [ Overlay ] ,
156+ deps : [ ] as any [ ] ,
155157 useFactory : MAT_SELECT_SCROLL_STRATEGY_PROVIDER_FACTORY ,
156158} ;
157159
0 commit comments