Skip to content

Commit

Permalink
fix(material-experimental/mdc-tabs): CSS applied to wrong element whe…
Browse files Browse the repository at this point in the history
…n preserveContent is enabled (#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.
  • Loading branch information
crisbeto authored Feb 3, 2022
1 parent 4102f3d commit 02d6e7d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/material-experimental/mdc-tabs/tab-body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
.mat-mdc-tab-group.mat-mdc-tab-group-dynamic-height &.mat-mdc-tab-body-active {
overflow-y: hidden;
}
}

.mat-mdc-tab-body-content {
height: 100%;
overflow: auto;

.mat-mdc-tab-group-dynamic-height & {
overflow: hidden;
}

// Usually the `visibility: hidden` added by the animation is enough to prevent focus from
// entering the collapsed content, but children with their own `visibility` can override it.
Expand All @@ -34,12 +43,3 @@
display: none;
}
}

.mat-mdc-tab-body-content {
height: 100%;
overflow: auto;

.mat-mdc-tab-group-dynamic-height & {
overflow: hidden;
}
}

0 comments on commit 02d6e7d

Please sign in to comment.