Skip to content

Commit 02d6e7d

Browse files
authored
fix(material-experimental/mdc-tabs): CSS applied to wrong element when preserveContent is enabled (angular#24346)
When `preserveContent` is enabled we add an extra `display: none` to prevent users from tabbing into hidden content. The selector was placed on the wrong element for the MDC-based tabs.
1 parent 4102f3d commit 02d6e7d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/material-experimental/mdc-tabs/tab-body.scss

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@
2222
.mat-mdc-tab-group.mat-mdc-tab-group-dynamic-height &.mat-mdc-tab-body-active {
2323
overflow-y: hidden;
2424
}
25+
}
26+
27+
.mat-mdc-tab-body-content {
28+
height: 100%;
29+
overflow: auto;
30+
31+
.mat-mdc-tab-group-dynamic-height & {
32+
overflow: hidden;
33+
}
2534

2635
// Usually the `visibility: hidden` added by the animation is enough to prevent focus from
2736
// entering the collapsed content, but children with their own `visibility` can override it.
@@ -34,12 +43,3 @@
3443
display: none;
3544
}
3645
}
37-
38-
.mat-mdc-tab-body-content {
39-
height: 100%;
40-
overflow: auto;
41-
42-
.mat-mdc-tab-group-dynamic-height & {
43-
overflow: hidden;
44-
}
45-
}

0 commit comments

Comments
 (0)