Skip to content

Commit

Permalink
fix(material/core): ripples not being clipped on safari in shadow dom (
Browse files Browse the repository at this point in the history
  • Loading branch information
crisbeto authored Jan 24, 2022
1 parent b3c9579 commit e03a770
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/material/core/ripple/_ripple.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
pointer-events: none;

transition: opacity, transform 0ms cubic-bezier(0, 0, 0.2, 1);
transform: scale(0);

// We use a 3d transform here in order to avoid an issue in Safari where
// the ripples aren't clipped when inside the shadow DOM (see #24028).
transform: scale3d(0, 0, 0);

// In high contrast mode the ripple is opaque, causing it to obstruct the content.
@include a11y.high-contrast(active, off) {
Expand Down
4 changes: 3 additions & 1 deletion src/material/core/ripple/ripple-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ export class RippleRenderer implements EventListenerObject {
// ripple elements. This is critical because then the `scale` would not animate properly.
enforceStyleRecalculation(ripple);

ripple.style.transform = 'scale(1)';
// We use a 3d transform here in order to avoid an issue in Safari where
// the ripples aren't clipped when inside the shadow DOM (see #24028).
ripple.style.transform = 'scale3d(1, 1, 1)';

// Exposed reference to the ripple that will be returned.
const rippleRef = new RippleRef(this, ripple, config);
Expand Down

0 comments on commit e03a770

Please sign in to comment.