Skip to content

bug(MatMenu): empty element not removed/hidden from DOM breaks flex layouts #21182

Closed
@tomasdev

Description

@tomasdev

Reproduction

Demo: https://stackblitz.com/edit/angular-vf8oer?file=src%2Fapp%2Fmenu-icons-example.html

Steps to reproduce:

  1. Create a mat-menu inside an element with display: flex

Expected Behavior

Given that mat-menu is only used to know what to show on the CDK overlay, it should be either safe to remove it or to have a display: none by default in its theme definition.

Actual Behavior

The render of <mat-menu> messes up the flex layout.

Environment

  • Angular: any
  • CDK/Material: any
  • Browser(s): any
  • Operating System (e.g. Windows, macOS, Ubuntu): any

Metadata

Metadata

Assignees

Labels

GThis is is related to a Google internal issueP3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/menu

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions