From 3644c0a36105ee07adc4f57b6cef6e01086f2e39 Mon Sep 17 00:00:00 2001 From: Amirhossein Fazli Date: Wed, 18 Nov 2020 11:19:42 +0330 Subject: [PATCH] amir-developer-fix-ripple-never-disappears-after-click-and-drag --- src/ripple.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ripple.js b/src/ripple.js index 55179c0..f1411f7 100644 --- a/src/ripple.js +++ b/src/ripple.js @@ -105,6 +105,8 @@ var Ripple = { }, 850); el.removeEventListener('mouseup', clearRipple, false); + el.removeEventListener('mouseleave', clearRipple, false); + el.removeEventListener('dragstart', clearRipple, false); // After removing event set position to target to it's original one // Timeout it's needed to avoid jerky effect of ripple jumping out parent target @@ -130,6 +132,8 @@ var Ripple = { if(event.type === 'mousedown') { el.addEventListener('mouseup', clearRipple, false); + el.addEventListener('mouseleave', clearRipple, false); + el.addEventListener('dragstart', clearRipple, false); } else { clearRipple(); }