Improvement of animationend event - docs (#1197)

* Improvement of animationend event - docs
This commit is contained in:
Mark Khromov 2020-12-29 13:29:01 +03:00 committed by GitHub
parent 09c6e3ee8a
commit 893cd44e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

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

View File

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