diff --git a/src/alerts/alerts.ts b/src/alerts/alerts.ts index ba67ff9..14d4cc3 100644 --- a/src/alerts/alerts.ts +++ b/src/alerts/alerts.ts @@ -47,6 +47,8 @@ export default class AlertsElement extends HTMLElement { public show(el: HTMLElement, options: AlertOptions = {}) { const key = options.key || el.dataset.key || String(this.index++); + this.dismiss(key); + el.dataset.key = key; if (!this.contains(el)) {