Skip to content

fix(multiple): remove touch tap highlights #26073

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 1 commit into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/material/button/_button-base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
// ripple and state container so that they fill the button, match the border radius, and avoid
// pointer events.
@mixin mat-private-button-interactive() {
-webkit-tap-highlight-color: transparent;

// The ripple container should match the bounds of the entire button.
.mat-mdc-button-ripple,
.mat-mdc-button-persistent-ripple,
Expand Down
1 change: 1 addition & 0 deletions src/material/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

// Avoids issues in some CSS grid layouts (see #25153).
position: relative;
-webkit-tap-highlight-color: transparent;

.mdc-checkbox {
// MDC theme styles also include structural styles so we have to include the theme at least
Expand Down
2 changes: 2 additions & 0 deletions src/material/chips/chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
}

.mat-mdc-standard-chip {
-webkit-tap-highlight-color: transparent;

@include mdc-helpers.disable-mdc-fallback-declarations {
@include mdc-chip-theme.theme-styles((
// Static tokens
Expand Down
1 change: 1 addition & 0 deletions src/material/core/option/option.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
mdc-list-variables.$side-padding, $query: mdc-helpers.$mdc-base-styles-query);
@include vendor-prefixes.user-select(none);
cursor: pointer;
-webkit-tap-highlight-color: transparent;

// If the MDC list is loaded after the option, this gets overwritten which breaks the text
// alignment. Ideally we'd wrap all the MDC mixins above with this selector, but the increased
Expand Down
11 changes: 5 additions & 6 deletions src/material/list/list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ a.mdc-list-item--activated {
}
}

// MDC expects that the list items are always `<li>`, since we actually use `<button>` in some
// cases, we need to make sure it expands to fill the available width.
.mat-mdc-list-item,
.mat-mdc-list-option {
// MDC expects that the list items are always `<li>`, since we actually use `<button>` in some
// cases, we need to make sure it expands to fill the available width.
width: 100%;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;

// MDC always sets the cursor to `pointer`. We do not want to show this for non-interactive
// lists. See: https://github.com/material-components/material-components-web/issues/6443
Expand All @@ -41,10 +42,8 @@ a.mdc-list-item--activated {
}
}

// MDC doesn't have list dividers, so we use mat-divider and style appropriately.
// TODO(devversion): check if we can use the MDC dividers.
.mat-mdc-list-item,
.mat-mdc-list-option {
// MDC doesn't have list dividers, so we use mat-divider and style appropriately.
// TODO(devversion): check if we can use the MDC dividers.
.mat-divider-inset {
position: absolute;
left: 0;
Expand Down
2 changes: 2 additions & 0 deletions src/material/radio/radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
}

.mat-mdc-radio-button {
-webkit-tap-highlight-color: transparent;

.mdc-radio {
// MDC theme styles also include structural styles so we have to include the theme at least
// once here. The values will be overwritten by our own theme file afterwards.
Expand Down
1 change: 1 addition & 0 deletions src/material/slide-toggle/slide-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

.mat-mdc-slide-toggle {
display: inline-block;
-webkit-tap-highlight-color: transparent;

// Remove the native outline since we use the ripple for focus indication.
outline: 0;
Expand Down
2 changes: 2 additions & 0 deletions src/material/tabs/_tabs-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ $mat-tab-animation-duration: 500ms !default;
}

@mixin tab {
-webkit-tap-highlight-color: transparent;

&.mdc-tab {
// This is usually included by MDC's tab bar, however we don't
// use it because we implement our own pagination.
Expand Down