From 59d204e9c9b13dd1a355a0a00c101b45333d70f2 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 15 Sep 2025 14:29:33 +0800 Subject: fix: exit animation not working delay destruction after animation is played --- src/lightbox.js | 1 - src/shadow.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lightbox.js b/src/lightbox.js index 2c2696c..b8ef08c 100644 --- a/src/lightbox.js +++ b/src/lightbox.js @@ -87,7 +87,6 @@ export default class LightBox { shadow.close(); this.overlay.hide(); - shadow.destroyItself(); } closeAll() { diff --git a/src/shadow.js b/src/shadow.js index 973125c..88bf210 100644 --- a/src/shadow.js +++ b/src/shadow.js @@ -117,6 +117,7 @@ export default class Shadow { requestAnimationFrame(frame); } else { this.element.classList.toggle('open'); + if (!this.isOpen) this.destroyItself(); } }; -- cgit v1.2.3