-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
Angular / Material 14
Description
If wrap a content of mat-menu-item
in ng-container
it breaks vertical alignment for mat-icon
and corresponding item text.
<button
mat-icon-button
[matMenuTriggerFor]="menu"
aria-label="Example icon-button with a menu"
>
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item> ← works fine without wrapper
<mat-icon>dialpad</mat-icon>
<span>Redial</span>
</button>
<button mat-menu-item>
<ng-container> ← breaks the alignment
<mat-icon>voicemail</mat-icon>
<span>Check voice mail</span>
</ng-container>
</button>
</mat-menu>
Reproduction
Steps to reproduce:
Please, see the example on stackblitz
- Wrap
mat-menu-item
inng-container
like this:
<button mat-menu-item>
<ng-container>
<mat-icon>voicemail</mat-icon>
<span>Check voice mail</span>
</ng-container>
</button>
Expected Behavior
Actual Behavior
Broken vertical alignment:
Environment
- Angular: 15.0.0 / 15.1.4
- CDK/Material: 15.1.4
- Browser(s): Any
- Operating System (e.g. Windows, macOS, Ubuntu): Any
AnkitaSood
Metadata
Metadata
Assignees
Labels
No labels