Skip to content

Commit

Permalink
fix(overlay): hide overlay container when there are no attached overl…
Browse files Browse the repository at this point in the history
…ays (#10139)

Hides the `.cdk-overlay-container` if it doesn't have any attached overlays. This prevents the browser from rendering it as a transparent overlay.

Fixes #6882.
Fixes #10033.
  • Loading branch information
crisbeto authored and tinayuangao committed Feb 28, 2018
1 parent 51fce51 commit 4b528f6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cdk/overlay/_overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
.cdk-overlay-container {
position: fixed;
z-index: $cdk-z-index-overlay-container;

&:empty {
// Hide the element when it doesn't have any child nodes. This doesn't
// include overlays that have been detached, rather than disposed.
display: none;
}
}

// We use an extra wrapper element in order to use make the overlay itself a flex item.
Expand Down

0 comments on commit 4b528f6

Please sign in to comment.