Skip to content

Commit

Permalink
fix: issue where the toasts container would reset on each toast remov…
Browse files Browse the repository at this point in the history
…e - Issue #139 (#340)
  • Loading branch information
Aviv-Galmidi authored Aug 22, 2023
1 parent 473b3fb commit cc643df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit cc643df

Please sign in to comment.