Open
Description
Reproduction
Steps to reproduce:
- In the menu trigger source code, add viewport margin to overlay position strategy.
private _getOverlayConfig(): OverlayConfig {
return new OverlayConfig({
positionStrategy: this._overlay.position()
.flexibleConnectedTo(this._element)
.withLockedPosition()
.withGrowAfterOpen()
.withViewportMargin(10) // add view port margin to avoid form covering scroll bar
.withTransformOriginOn('.mat-menu-panel, .mat-mdc-menu-panel'),
backdropClass: this.menu.backdropClass || 'cdk-overlay-transparent-backdrop',
panelClass: this.menu.overlayPanelClass,
scrollStrategy: this._scrollStrategy(),
direction: this._dir
});
- Set menu position: xPosition="before", yPosition="below".
- Click the menu trigger button, the menu overlay panel is not right-aligned.
Expected Behavior
What behavior were you expecting to see?
The menu overlay panel should right align with the trigger button.
Actual Behavior
What behavior did you actually see?
The menu overlay panel's right position is wrong.
Environment
- Angular:
- CDK/Material:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):