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'); }