7
7
*/
8
8
9
9
import { Dialog } from '@angular/cdk/dialog' ;
10
- import { Overlay } from '@angular/cdk/overlay' ;
10
+ import { createBlockScrollStrategy , createGlobalPositionStrategy } from '@angular/cdk/overlay' ;
11
11
import { 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' ;
13
13
import { MAT_BOTTOM_SHEET_DATA , MatBottomSheetConfig } from './bottom-sheet-config' ;
14
14
import { MatBottomSheetContainer } from './bottom-sheet-container' ;
15
15
import { MatBottomSheetRef } from './bottom-sheet-ref' ;
@@ -25,7 +25,7 @@ export const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS = new InjectionToken<MatBottomShee
25
25
*/
26
26
@Injectable ( { providedIn : 'root' } )
27
27
export class MatBottomSheet implements OnDestroy {
28
- private _overlay = inject ( Overlay ) ;
28
+ private _injector = inject ( Injector ) ;
29
29
private _parentBottomSheet = inject ( MatBottomSheet , { optional : true , skipSelf : true } ) ;
30
30
private _animationsDisabled = _animationsDisabled ( ) ;
31
31
private _defaultOptions = inject < MatBottomSheetConfig > ( MAT_BOTTOM_SHEET_DEFAULT_OPTIONS , {
@@ -89,8 +89,10 @@ export class MatBottomSheet implements OnDestroy {
89
89
closeOnOverlayDetachments : false ,
90
90
maxWidth : '100%' ,
91
91
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' ) ,
94
96
disableAnimations : this . _animationsDisabled ,
95
97
templateContext : ( ) => ( { bottomSheetRef : ref } ) ,
96
98
providers : ( cdkRef , _cdkConfig , container ) => {
0 commit comments