Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose parameter to prevent menu from being pushed #28450

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/material/menu/menu-trigger.ts
Expand Up @@ -189,6 +189,11 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
*/
@Input('matMenuTriggerRestoreFocus') restoreFocus: boolean = true;

/**
* Whether menu will reposition to fit in the viewport.
*/
@Input('matMenuRepositionOverlay') reposition: boolean = true;

/** Event emitted when the associated menu is opened. */
@Output() readonly menuOpened: EventEmitter<void> = new EventEmitter<void>();

Expand Down Expand Up @@ -496,6 +501,7 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
.flexibleConnectedTo(this._element)
.withLockedPosition()
.withGrowAfterOpen()
.withPush(this.reposition)
.withTransformOriginOn('.mat-menu-panel, .mat-mdc-menu-panel'),
backdropClass: menu.backdropClass || 'cdk-overlay-transparent-backdrop',
panelClass: menu.overlayPanelClass,
Expand Down