angular / angular/components

bug(MatList): matListItemMeta forces color onto any element under it

Ouverte
#27,144 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area: material/list P3
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.3.0

### Description

After the material migration to Angular 15, we have lost the ability to freely change the color elements within the matListItemMeta directive.

This means that if you put two buttons in an element of the list, one enabled and one disabled, they will both appear to be of the same color. This makes buttons appear disabled even when they're not.

Of course this directive didn't exist in Angular 14, but it is the only place to put these elements in this version.

I understand this might have been on purpose as it appears that this section might only be intended for text, but it makes a great drawer for buttons that perform actions on elements of the list, and it used to work perfectly for this.

### Reproduction

This happens both in Angular 15 and 16

Angular 15:
https://stackblitz.com/edit/components-issue-gvbxke?file=src%2Fapp%2Fexample-component.html

Angular 16:
https://stackblitz.com/edit/angular-16-material-starter-upzbq5?file=src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.html

### Expected Behavior

When putting buttons or icons inside the matListItemMeta they should keep their color.

### Actual Behavior

When putting buttons or icons inside the matListItemMeta they change their color to grey (same exact color as a disabled button), affecting the usability of buttons.

### Environment

- Angular: 15&16
- CDK/Material: 15.2.9 (latest)
Package Manager: npm 8.19.2
- Operating System : Ubuntu 20.04.6 LTS

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par les reproductions Angular 15 et Angular 16 liées dans StackBlitz, en particulier example-component.html, app.module.ts et app.component.html, afin de confirmer l’impact de matListItemMeta sur les boutons et les icônes imbriqués. Suivez le style de matListItemMeta et vérifiez que les contrôles activés et désactivés conservent leurs couleurs prévues, tout en maintenant intact le comportement existant de la liste.

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é
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

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