From 893cd44e0a5d4044d18197ec80db6c8441725fe8 Mon Sep 17 00:00:00 2001 From: Mark Khromov Date: Tue, 29 Dec 2020 13:29:01 +0300 Subject: [PATCH] Improvement of animationend event - docs (#1197) * Improvement of animationend event - docs --- docs/index.html | 3 ++- docsSource/sections/04-javascript.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 5e9e671..134adfd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1121,7 +1121,8 @@ element.style.setProperty('--animate-duration', '0.5s'); node.classList.add(`${prefix}animated`, animationName); // When the animation ends, we clean the classes and resolve the Promise - function handleAnimationEnd() { + function handleAnimationEnd(event) { + event.stopPropagation(); node.classList.remove(`${prefix}animated`, animationName); resolve('Animation ended'); } diff --git a/docsSource/sections/04-javascript.md b/docsSource/sections/04-javascript.md index 2b9e3ee..ea4e1e9 100644 --- a/docsSource/sections/04-javascript.md +++ b/docsSource/sections/04-javascript.md @@ -37,7 +37,8 @@ const animateCSS = (element, animation, prefix = 'animate__') => node.classList.add(`${prefix}animated`, animationName); // When the animation ends, we clean the classes and resolve the Promise - function handleAnimationEnd() { + function handleAnimationEnd(event) { + event.stopPropagation(); node.classList.remove(`${prefix}animated`, animationName); resolve('Animation ended'); }