Skip to content

Commit

Permalink
fix(overlay): hide overlay container when there are no attached overlays
Browse files Browse the repository at this point in the history
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 angular#6882.
Fixes angular#10033.
  • Loading branch information
crisbeto committed Feb 25, 2018
1 parent 64ef3a8 commit 55ba350
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 55ba350

Please sign in to comment.