Skip to content

Commit 233126a

Browse files
committed
fix(radio): don't show hover ripples on touch devices
On touch devices `:hover` styling persists after the user has tapped. These changes hide the persistent ripple if the user isn't able to hover, in order to avoid confusion with the other ripples. Related to #13675.
1 parent efeefd1 commit 233126a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib/radio/radio.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ $mat-radio-ripple-radius: 20px;
151151
&, .mat-radio-disabled .mat-radio-container:hover & {
152152
opacity: 0;
153153
}
154+
155+
// Hover styles will be displayed after tapping on touch devices.
156+
// Disable the hover styling if the user's device doesn't support hovering.
157+
@media (hover: none) {
158+
.mat-radio-container:hover & {
159+
display: none;
160+
}
161+
}
154162
}
155163

156164
.mat-radio-input {

0 commit comments

Comments
 (0)