Skip to content

Commit 10a0ee4

Browse files
committed
fix(multiple): remove touch tap highlights
Removes the touchscreen device tap highlights from the various components where we have similar indication. Fixes #26068.
1 parent 57676e4 commit 10a0ee4

File tree

8 files changed

+16
-7
lines changed

8 files changed

+16
-7
lines changed

src/material/button/_button-base.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// ripple and state container so that they fill the button, match the border radius, and avoid
1111
// pointer events.
1212
@mixin mat-private-button-interactive() {
13+
-webkit-tap-highlight-color: transparent;
14+
1315
// The ripple container should match the bounds of the entire button.
1416
.mat-mdc-button-ripple,
1517
.mat-mdc-button-persistent-ripple,

src/material/checkbox/checkbox.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

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

3435
.mdc-checkbox {
3536
// MDC theme styles also include structural styles so we have to include the theme at least

src/material/chips/chip.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
}
6060

6161
.mat-mdc-standard-chip {
62+
-webkit-tap-highlight-color: transparent;
63+
6264
@include mdc-helpers.disable-mdc-fallback-declarations {
6365
@include mdc-chip-theme.theme-styles((
6466
// Static tokens

src/material/core/option/option.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
mdc-list-variables.$side-padding, $query: mdc-helpers.$mdc-base-styles-query);
1515
@include vendor-prefixes.user-select(none);
1616
cursor: pointer;
17+
-webkit-tap-highlight-color: transparent;
1718

1819
// If the MDC list is loaded after the option, this gets overwritten which breaks the text
1920
// alignment. Ideally we'd wrap all the MDC mixins above with this selector, but the increased

src/material/list/list.scss

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,16 @@ a.mdc-list-item--activated {
2727
}
2828
}
2929

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

38-
// MDC doesn't have list dividers, so we use mat-divider and style appropriately.
39-
// TODO(devversion): check if we can use the MDC dividers.
40-
.mat-mdc-list-item,
41-
.mat-mdc-list-option {
38+
// MDC doesn't have list dividers, so we use mat-divider and style appropriately.
39+
// TODO(devversion): check if we can use the MDC dividers.
4240
.mat-divider-inset {
4341
position: absolute;
4442
left: 0;

src/material/radio/radio.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
}
1616

1717
.mat-mdc-radio-button {
18+
-webkit-tap-highlight-color: transparent;
19+
1820
.mdc-radio {
1921
// MDC theme styles also include structural styles so we have to include the theme at least
2022
// once here. The values will be overwritten by our own theme file afterwards.

src/material/slide-toggle/slide-toggle.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
.mat-mdc-slide-toggle {
1717
display: inline-block;
18+
-webkit-tap-highlight-color: transparent;
1819

1920
// Remove the native outline since we use the ripple for focus indication.
2021
outline: 0;

src/material/tabs/_tabs-common.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ $mat-tab-animation-duration: 500ms !default;
2626
}
2727

2828
@mixin tab {
29+
-webkit-tap-highlight-color: transparent;
30+
2931
&.mdc-tab {
3032
// This is usually included by MDC's tab bar, however we don't
3133
// use it because we implement our own pagination.

0 commit comments

Comments
 (0)