77 */
88
99import { Dialog } from '@angular/cdk/dialog' ;
10- import { Overlay } from '@angular/cdk/overlay' ;
10+ import { createBlockScrollStrategy , createGlobalPositionStrategy } from '@angular/cdk/overlay' ;
1111import { ComponentType } from '@angular/cdk/portal' ;
12- import { Injectable , TemplateRef , InjectionToken , OnDestroy , inject } from '@angular/core' ;
12+ import { Injectable , TemplateRef , InjectionToken , OnDestroy , inject , Injector } from '@angular/core' ;
1313import { MAT_BOTTOM_SHEET_DATA , MatBottomSheetConfig } from './bottom-sheet-config' ;
1414import { MatBottomSheetContainer } from './bottom-sheet-container' ;
1515import { MatBottomSheetRef } from './bottom-sheet-ref' ;
@@ -25,7 +25,7 @@ export const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS = new InjectionToken<MatBottomShee
2525 */
2626@Injectable ( { providedIn : 'root' } )
2727export class MatBottomSheet implements OnDestroy {
28- private _overlay = inject ( Overlay ) ;
28+ private _injector = inject ( Injector ) ;
2929 private _parentBottomSheet = inject ( MatBottomSheet , { optional : true , skipSelf : true } ) ;
3030 private _animationsDisabled = _animationsDisabled ( ) ;
3131 private _defaultOptions = inject < MatBottomSheetConfig > ( MAT_BOTTOM_SHEET_DEFAULT_OPTIONS , {
@@ -89,8 +89,10 @@ export class MatBottomSheet implements OnDestroy {
8989 closeOnOverlayDetachments : false ,
9090 maxWidth : '100%' ,
9191 container : MatBottomSheetContainer ,
92- scrollStrategy : _config . scrollStrategy || this . _overlay . scrollStrategies . block ( ) ,
93- positionStrategy : this . _overlay . position ( ) . global ( ) . centerHorizontally ( ) . bottom ( '0' ) ,
92+ scrollStrategy : _config . scrollStrategy || createBlockScrollStrategy ( this . _injector ) ,
93+ positionStrategy : createGlobalPositionStrategy ( this . _injector )
94+ . centerHorizontally ( )
95+ . bottom ( '0' ) ,
9496 disableAnimations : this . _animationsDisabled ,
9597 templateContext : ( ) => ( { bottomSheetRef : ref } ) ,
9698 providers : ( cdkRef , _cdkConfig , container ) => {
0 commit comments