Skip to content

Commit c2700b6

Browse files
crisbetovictoriaaa234
authored andcommitted
fix(expansion-panel): disable hover highlight on non-hover devices (#12080)
Disables the expansion panel header's hover if the device doesn't support hovering. This prevents the header from appearing as stuck if the user taps it on a touch device. Relates to #12030.
1 parent 26f9e50 commit c2700b6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib/expansion/_expansion-theme.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
}
2626
}
2727

28+
// Disable the hover on touch devices since it can appear like it is stuck. We can't use
29+
// `@media (hover)` above, because the desktop support browser support isn't great.
30+
@media (hover: none) {
31+
.mat-expansion-panel:not(.mat-expanded):not([aria-disabled='true'])
32+
.mat-expansion-panel-header:hover {
33+
background: mat-color($background, card);
34+
}
35+
}
36+
2837
.mat-expansion-panel-header-title {
2938
color: mat-color($foreground, text);
3039
}

0 commit comments

Comments
 (0)