angular / angular/components

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

Offen
#26,723 8 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
area: material/icon area: material/list P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der Implementierung von Angular Material mat-selection-list und mat-list-option und deren Hover-Styling. Reproduziere anschließend das Problem mit dem bereitgestellten mat-icon matListItemIcon-Beispiel in Angular/Material 15. Verfolge, welche Hover-Regel das color-Attribut des Icons überschreibt, und füge den relevanten Komponententest hinzu oder aktualisiere ihn, falls einer vorhanden ist; fertig ist die Änderung, wenn die Akzentfarbe beim Hover sichtbar bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
angular, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.