Skip to content

Commit 1cc831c

Browse files
authored
fix(material/menu): add selector for projecting non-Material icons (#26235)
Adds the `matMenuItemIcon` selector to the `ng-content` so icons that aren't `mat-icon` can be projected in the correct place. Fixes #26214.
1 parent 08c5a12 commit 1cc831c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/material/menu/menu-item.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ng-content select="mat-icon"></ng-content>
1+
<ng-content select="mat-icon, [matMenuItemIcon]"></ng-content>
22
<span class="mdc-list-item__primary-text"><ng-content></ng-content></span>
33
<div class="mat-mdc-menu-ripple" matRipple
44
[matRippleDisabled]="disableRipple || disabled"

tools/public_api_guard/material/menu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class MatMenuItem extends _MatMenuItemBase implements FocusableOption, Ca
217217
_setTriggersSubmenu(triggersSubmenu: boolean): void;
218218
_triggersSubmenu: boolean;
219219
// (undocumented)
220-
static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "disabled": "disabled"; "disableRipple": "disableRipple"; "role": "role"; }, {}, never, ["mat-icon", "*"], false, never>;
220+
static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "disabled": "disabled"; "disableRipple": "disableRipple"; "role": "role"; }, {}, never, ["mat-icon, [matMenuItemIcon]", "*"], false, never>;
221221
// (undocumented)
222222
static ɵfac: i0.ɵɵFactoryDeclaration<MatMenuItem, [null, null, null, { optional: true; }, null]>;
223223
}

0 commit comments

Comments
 (0)