Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 15da974

Browse files
cyx8808ThomasBurleson
authored andcommitted
fix(ripple): fix ripple artifacts in Chrome v51
Closes #8824
1 parent 97e30d8 commit 15da974

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/core/services/ripple/ripple.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ InkRippleCtrl.prototype.removeRipple = function (ripple) {
432432
if (index < 0) return;
433433
this.ripples.splice(this.ripples.indexOf(ripple), 1);
434434
ripple.removeClass('md-ripple-active');
435+
ripple.addClass('md-ripple-remove');
435436
if (this.ripples.length === 0) this.container.css({ backgroundColor: '' });
436437
// use a 2-second timeout in order to allow for the animation to finish
437438
// we don't actually care how long the animation takes

src/core/style/structure.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ input {
115115
}
116116

117117
.md-ripple {
118+
$sizeDuration: 0.45s * 2;
118119
position: absolute;
119120
transform: translate(-50%, -50%) scale(0);
120121
transform-origin: 50% 50%;
121122
opacity: 0;
122123
border-radius: 50%;
123124
&.md-ripple-placed {
124-
$sizeDuration: 0.45s * 2;
125125
transition: margin $sizeDuration $swift-ease-out-timing-function,
126126
border $sizeDuration $swift-ease-out-timing-function,
127127
width $sizeDuration $swift-ease-out-timing-function,
@@ -135,6 +135,15 @@ input {
135135
&.md-ripple-active, &.md-ripple-full, &.md-ripple-visible {
136136
opacity: 0.20;
137137
}
138+
&.md-ripple-remove {
139+
animation: md-remove-ripple $sizeDuration $swift-ease-out-timing-function;
140+
}
141+
}
142+
143+
// Fix issue causing ripple disappear suddenly in Chrome version 51, opacity .15 is close to the opacity when a normal click mouseup
144+
@keyframes md-remove-ripple {
145+
0% { opacity: .15; }
146+
100% { opacity: 0; }
138147
}
139148

140149
.md-padding {

0 commit comments

Comments
 (0)