angular / angular/components

bug(mat-selection-list): Color attribute on (mat-list-option/mat-icon - matListItemIcon) is ignored on hover.

Ouverte
#26,723 8 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area: material/icon 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?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

A mat-icon, located inside a mat-list-option, that has the matListItemIcon directive and has color="accent" (or other theming), loses its color when hovered.

Example:
```


play_arrow
{{pr.user.login}}
{{pr.title}}

```

### Reproduction

Steps to reproduce:
1. Add `color="accent"` to a mat-selection-list > mat-list-option > mat-icon (matListItemIcon)
2. Hover the icon.
3. Accent color goes away and is replaced by a default color.

### Expected Behavior

I would expect the accent color on mat-icon to stay when it is hovered. If the issue here is that for accessibility, hovered items need to visually identify, the background of the mat-list-option itself is already doing that.

### Actual Behavior

Theme colors are lost when the mat-list-option is hovered

### Environment

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’implémentation de Angular Material mat-selection-list et mat-list-option ainsi que par leur style au survol, puis reproduisez le problème à l’aide de l’exemple fourni mat-icon matListItemIcon dans Angular/Material 15. Identifiez quelle règle de survol remplace l’attribut color de l’icône et ajoutez ou mettez à jour le test du composant concerné s’il en existe un ; le travail est terminé lorsque la couleur d’accent reste visible au survol.

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
35/100

Recevez les nouvelles issues par e-mail

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