Skip to content

Commit

Permalink
Do not run animation if cssClass is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Mar 28, 2024
1 parent 350f370 commit 09ef11d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/animation.ts
Expand Up @@ -69,7 +69,7 @@ export class AnimationUtils {
}
}
protected runLeaveAnimation(element: HTMLElement, options: AnimationOptions, callback: () => void): void {
if(element) {
if(element && options.cssClass) {
element.classList.add(options.cssClass);
const onAnimationEndCallback = (isCancel?: boolean) => {
callback();
Expand All @@ -89,7 +89,7 @@ export class AnimationUtils {
}
}
protected runEnterAnimation(element: HTMLElement, options: AnimationOptions): void {
if(element) {
if(element && options.cssClass) {
element.classList.add(options.cssClass);
this.onAnimationEnd(element, () => {
element.classList.remove(options.cssClass);
Expand Down

0 comments on commit 09ef11d

Please sign in to comment.