angular / angular/components

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

Abierto
#27,006 4 comentarios 6 reacciones 0 asignados Ver en GitHub
area: material/menu P3 regression
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Compara src/material/menu/menu-item.html en las referencias v15.2.x y v14.2.x y, después, inspecciona el ejemplo relacionado src/material/button/button.html en busca de iconPositionEnd y matButtonIcon. Usa la reproducción proporcionada de mat-menu-item con iconos antes y después de la etiqueta; se considera terminado cuando el icono final puede permanecer al final mientras el icono inicial permanece al principio.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.