Skip to content

Commit 9efb60f

Browse files
committed
fix(material/tabs): unable to click projected content in tab label (#26527)
Fixes that the MDC-based tabs implementation didn't allow clicks on the projected content inside a tab, because MDC was setting `pointer-events: none`. Fixes #26195. (cherry picked from commit fd9853d)
1 parent 43c5fcd commit 9efb60f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/material/tabs/_tabs-common.scss

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ $mat-tab-animation-duration: 500ms !default;
5959
align-items: center;
6060
}
6161

62-
// Required for `fitInkBarToContent` to work. This used to be included with MDC's `without-ripple`
63-
// mixin, but that no longer appears to be the case with `static-styles`. Since the latter is
64-
// ~10kb smaller, we include this one extra style ourselves.
6562
.mdc-tab__content {
63+
// Required for `fitInkBarToContent` to work. This used to be included with MDC's
64+
// `without-ripple` mixin, but that no longer appears to be the case with `static-styles`.
65+
// Since the latter is ~10kb smaller, we include this one extra style ourselves.
6666
@include mdc-tab-indicator.surface;
67+
68+
// MDC sets `pointer-events: none` on the content which prevents interactions with the
69+
// nested content. Re-enable it since we allow nesting any content in the tab (see #26195).
70+
pointer-events: auto;
6771
}
6872

6973
// We need to handle the hover and focus indication ourselves, because we don't use MDC's ripple.

0 commit comments

Comments
 (0)