Skip to content

bug(mat-menu-item): iconPositionEnd and matButtonIcon is not available for mat-menu-item #27006

Open
@mangei

Description

@mangei

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

14.x

Description

Since there was a change in mat-menu-item, that all icons are moved to the start, it is not possible anymore to place icons after the label. This breaks our current design (we have icons in front and after the label)

v15: https://github.com/angular/components/blob/15.2.x/src/material/menu/menu-item.html
v14: https://github.com/angular/components/blob/14.2.x/src/material/menu/menu-item.html

The solution would be to also support iconPositionEnd for mat-menu-items as it was done for mat-button.
https://github.com/angular/components/blob/15.2.x/src/material/button/button.html#L11

matButtonIcon should be supported as well.

Bonus: It would probably be even better to not pull the icons automatically to a certain position (like it was before) or to have an additional attribute, so that an icon is not effected by the pulling (e.g. iconPositionInline --> <mat-icon iconPositionInline>...</mat-icon>). I am not sure, if this is possible with the new mdc and the change happened in the first place, because the new css-class effected the icons. Nevertheless, iconPositionEnd should be possible.

Thank you!
~Manuel

Reproduction

<button mat-menu-item>
   <mat-icon>settings</mat-icon>
   Settings
   <mat-icon>open_in_new</mat-icon>
</button>

Expected Behavior

It should be possible to have buttons at the start and at the end (or inline).

Actual Behavior

Both/all icons are in the start.

Environment

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/menuregressionThis issue is related to a regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions