Skip to content

Commit

Permalink
fix(material/menu): add selector for projecting non-Material icons (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
crisbeto committed Dec 13, 2022
1 parent 08c5a12 commit 1cc831c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/material/menu/menu-item.html
@@ -1,4 +1,4 @@
<ng-content select="mat-icon"></ng-content>
<ng-content select="mat-icon, [matMenuItemIcon]"></ng-content>
<span class="mdc-list-item__primary-text"><ng-content></ng-content></span>
<div class="mat-mdc-menu-ripple" matRipple
[matRippleDisabled]="disableRipple || disabled"
Expand Down
2 changes: 1 addition & 1 deletion tools/public_api_guard/material/menu.md
Expand Up @@ -217,7 +217,7 @@ export class MatMenuItem extends _MatMenuItemBase implements FocusableOption, Ca
_setTriggersSubmenu(triggersSubmenu: boolean): void;
_triggersSubmenu: boolean;
// (undocumented)
static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "disabled": "disabled"; "disableRipple": "disableRipple"; "role": "role"; }, {}, never, ["mat-icon", "*"], false, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<MatMenuItem, "[mat-menu-item]", ["matMenuItem"], { "disabled": "disabled"; "disableRipple": "disableRipple"; "role": "role"; }, {}, never, ["mat-icon, [matMenuItemIcon]", "*"], false, never>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatMenuItem, [null, null, null, { optional: true; }, null]>;
}
Expand Down

0 comments on commit 1cc831c

Please sign in to comment.