File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,8 @@ export class OverlayContainer implements OnDestroy {
439439
440440// @public
441441export interface OverlayDefaultConfig {
442+ // (undocumented)
443+ alwaysInline? : boolean ;
442444 // (undocumented)
443445 usePopover? : boolean ;
444446}
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import {ScrollStrategyOptions} from './scroll/index';
3434
3535/** Object used to configure the default options for overlays. */
3636export interface OverlayDefaultConfig {
37+ alwaysInline ?: boolean ;
3738 usePopover ?: boolean ;
3839}
3940
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717 HorizontalConnectionPos ,
1818 OverlayConfig ,
1919 OverlayRef ,
20+ OVERLAY_DEFAULT_CONFIG ,
2021 ScrollStrategy ,
2122 VerticalConnectionPos ,
2223} from '@angular/cdk/overlay' ;
@@ -354,19 +355,24 @@ export abstract class MatMenuTriggerBase implements OnDestroy {
354355 * @returns OverlayConfig
355356 */
356357 private _getOverlayConfig ( menu : MatMenuPanel ) : OverlayConfig {
358+ const inline =
359+ this . _injector . get ( OVERLAY_DEFAULT_CONFIG , null , { optional : true } ) ?. alwaysInline ?? false ;
360+
357361 return new OverlayConfig ( {
358362 positionStrategy : createFlexibleConnectedPositionStrategy (
359363 this . _injector ,
360364 this . _getOverlayOrigin ( ) ,
361365 )
362366 . withLockedPosition ( )
363367 . withGrowAfterOpen ( )
368+ . withPopoverLocation ( inline ? 'inline' : 'global' )
364369 . withTransformOriginOn ( '.mat-menu-panel, .mat-mdc-menu-panel' ) ,
365370 backdropClass : menu . backdropClass || 'cdk-overlay-transparent-backdrop' ,
366371 panelClass : menu . overlayPanelClass ,
367372 scrollStrategy : this . _scrollStrategy ( ) ,
368373 direction : this . _dir || 'ltr' ,
369374 disableAnimations : this . _animationsDisabled ,
375+ usePopover : true ,
370376 } ) ;
371377 }
372378
You can’t perform that action at this time.
0 commit comments