Skip to content

Commit

Permalink
fix(overlay): transparent overlay not blocking scroll on Firefox 57 (#…
Browse files Browse the repository at this point in the history
…9446)

As of Firefox 57, it looks like elements with a transparent background won't capture scroll events. These changes work around the issue by not setting the background color, but using `opacity` to hide the element while keeping it scrollable.

Fixes #8924.
  • Loading branch information
crisbeto authored and jelbourn committed Jan 29, 2018
1 parent 7cea0b6 commit e2999a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cdk/overlay/_overlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
}

.cdk-overlay-transparent-backdrop {
background: none;
// Note: as of Firefox 57, having the backdrop be `background: none` will prevent it from
// capturing the user's mouse scroll events. Since we also can't use something like
// `rgba(0, 0, 0, 0)`, we work around the inconsistency by not setting the background at
// all and using `opacity` to make the element transparent.
&, &.cdk-overlay-backdrop-showing {
opacity: 0;
}
}

// Used when disabling global scrolling.
Expand Down

0 comments on commit e2999a8

Please sign in to comment.