Skip to content

Commit 5c97134

Browse files
committed
fix(list): action list missing focus and hover styling
Since the action list is interactive, it needs styles when it's hovered and focused.
1 parent 39888f3 commit 5c97134

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/lib/list/_list-theme.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
}
2828

2929
.mat-list-option,
30-
.mat-nav-list .mat-list-item {
30+
.mat-nav-list .mat-list-item,
31+
.mat-action-list .mat-list-item {
3132
&:hover, &:focus {
3233
background: mat-color($background, 'hover');
3334
}

src/lib/list/list.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ mat-action-list {
295295
// use something like `@media (hover)`.
296296
@media (hover: none) {
297297
.mat-list-option,
298-
.mat-nav-list .mat-list-item {
298+
.mat-nav-list .mat-list-item,
299+
.mat-action-list .mat-list-item {
299300
&:not(.mat-list-item-disabled):hover {
300301
background: none;
301302
}

src/lib/list/list.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ export class MatList extends _MatListMixinBase implements CanDisableRipple {
7474
*/
7575
constructor(private _elementRef?: ElementRef<HTMLElement>) {
7676
super();
77+
78+
if (this._getListType() === 'action-list' && _elementRef) {
79+
_elementRef.nativeElement.classList.add('mat-action-list');
80+
}
7781
}
7882

7983
_getListType(): 'list' | 'action-list' | null {

0 commit comments

Comments
 (0)