Skip to content

fix(checkbox): don't show hover ripples on touch devices #13700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/material/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,16 @@ $_mat-checkbox-mark-stroke-size: 2 / 15 * $mat-checkbox-size !default;
&, .mat-checkbox.mat-disabled .mat-checkbox-inner-container:hover & {
opacity: 0;
}

// Hover styles will be displayed after tapping on touch devices.
// Disable the hover styling if the user's device doesn't support hovering.
@media (hover: none) {
// Note that we only negate the `:hover` rather than setting it to always be `display: none`,
// in order to maintain the focus indication for hybrid touch + keyboard devices.
.mat-checkbox-inner-container:hover & {
display: none;
}
}
}

.mat-checkbox-checkmark {
Expand Down