Skip to content

Commit

Permalink
fix(ripple): fix ripple artifacts in Chrome v51
Browse files Browse the repository at this point in the history
  • Loading branch information
cyx8808 authored and ThomasBurleson committed Jun 23, 2016
1 parent 97e30d8 commit 15da974
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/services/ripple/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ InkRippleCtrl.prototype.removeRipple = function (ripple) {
if (index < 0) return;
this.ripples.splice(this.ripples.indexOf(ripple), 1);
ripple.removeClass('md-ripple-active');
ripple.addClass('md-ripple-remove');
if (this.ripples.length === 0) this.container.css({ backgroundColor: '' });
// use a 2-second timeout in order to allow for the animation to finish
// we don't actually care how long the animation takes
Expand Down
11 changes: 10 additions & 1 deletion src/core/style/structure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ input {
}

.md-ripple {
$sizeDuration: 0.45s * 2;
position: absolute;
transform: translate(-50%, -50%) scale(0);
transform-origin: 50% 50%;
opacity: 0;
border-radius: 50%;
&.md-ripple-placed {
$sizeDuration: 0.45s * 2;
transition: margin $sizeDuration $swift-ease-out-timing-function,
border $sizeDuration $swift-ease-out-timing-function,
width $sizeDuration $swift-ease-out-timing-function,
Expand All @@ -135,6 +135,15 @@ input {
&.md-ripple-active, &.md-ripple-full, &.md-ripple-visible {
opacity: 0.20;
}
&.md-ripple-remove {
animation: md-remove-ripple $sizeDuration $swift-ease-out-timing-function;
}
}

// Fix issue causing ripple disappear suddenly in Chrome version 51, opacity .15 is close to the opacity when a normal click mouseup
@keyframes md-remove-ripple {
0% { opacity: .15; }
100% { opacity: 0; }
}

.md-padding {
Expand Down

0 comments on commit 15da974

Please sign in to comment.