From cc643df059607f6cb8bfa8c58ac86791a2c0dd1f Mon Sep 17 00:00:00 2001 From: Aviv Galmidi Date: Tue, 22 Aug 2023 17:07:17 +0300 Subject: [PATCH] fix: issue where the toasts container would reset on each toast remove - Issue #139 (#340) --- src/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 003f6cf..c78f1cd 100644 --- a/src/index.js +++ b/src/index.js @@ -187,18 +187,17 @@ class Toast { this.onAnimationEnd(() => { this.removeParent(this.element.parentNode) this.element.remove() - delete containers.position }) } else { this.removeParent(this.element.parentNode) this.element.remove() - delete containers.position } } removeParent(element) { if (element && element.children.length <= 1) { element.remove() + delete containers.position } }