Skip to content

Commit

Permalink
fix(material/menu): allow menu height to grow after open (#21436)
Browse files Browse the repository at this point in the history
Currently the menu only shrinks if the users scrolls after it has been opened, but
if they scroll back to a place where there's enough place to fit the content, the menu
will stay collapsed.

These changes adjust the config so the menu can grow after it was opened.

Fixes #18168.
Fixes #13988.

(cherry picked from commit 83f2adc)
  • Loading branch information
crisbeto authored and annieyw committed Jan 9, 2021
1 parent 760fb30 commit bc5c3a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/material/menu/menu-trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ export class MatMenuTrigger implements AfterContentInit, OnDestroy {
positionStrategy: this._overlay.position()
.flexibleConnectedTo(this._element)
.withLockedPosition()
.withGrowAfterOpen()
.withTransformOriginOn('.mat-menu-panel, .mat-mdc-menu-panel'),
backdropClass: this.menu.backdropClass || 'cdk-overlay-transparent-backdrop',
panelClass: this.menu.overlayPanelClass,
Expand Down

0 comments on commit bc5c3a7

Please sign in to comment.