Skip to content

Commit 48ce308

Browse files
committed
fix(material-experimental/mdc-list): do not show pointer cursor for non-interactive list items
The MDC list currently always shows the pointer cursor for all kinds of list items, regardless of them being interactive or not (through instantiation of the foundation). This seems to be unexpected as the pointer cursor incorrectly suggests interactivity of a list item to users. We manually reset the cursor for non-interactive list items and report an issue upstream: material-components/material-components-web#6443 Note: MDC list does no longer seem to support the `non-interactive` class we previously used, so we replace it with our own.
1 parent 4ae2d93 commit 48ce308

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/material-experimental/mdc-list/list-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export abstract class MatListItemBase implements AfterContentInit, OnDestroy, Ri
138138
@Directive()
139139
/** @docs-private */
140140
export abstract class MatListBase {
141-
@HostBinding('class.mdc-list--non-interactive')
141+
@HostBinding('class.mat-mdc-list-non-interactive')
142142
_isNonInteractive: boolean = true;
143143

144144
/** Whether ripples for all list items is disabled. */

src/material-experimental/mdc-list/list.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@
105105
opacity: 0;
106106
}
107107

108+
// MDC always sets the cursor to `pointer`. We do not want to show this for non-interactive
109+
// lists. See: https://github.com/material-components/material-components-web/issues/6443
110+
.mat-mdc-list-non-interactive .mdc-list-item {
111+
cursor: default;
112+
}
113+
108114
// The MDC-based list items already use the `::before` pseudo element for the standard
109115
// focus/selected/hover state. Hence, we need to have a separate list-item spanning
110116
// element that can be used for strong focus indicators.

0 commit comments

Comments
 (0)