angular / angular/components

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

Ouverte
#27,006 4 commentaires 6 réactions 0 personnes assignées Voir sur GitHub
area: material/menu P3 regression
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### Is this a regression?

- [X] 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` --> `...`). 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

```

settings
Settings
open_in_new

```

### 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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Comparez src/material/menu/menu-item.html dans les références v15.2.x et v14.2.x, puis examinez l’exemple associé src/material/button/button.html pour iconPositionEnd et matButtonIcon. Utilisez la reproduction fournie de mat-menu-item avec des icônes avant et après le libellé ; le travail est terminé lorsque l’icône de fin peut rester à la fin tandis que l’icône de début reste au début.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.