Skip to content

Commit

Permalink
fix(alerts): fix previous alert with same key not being dismissed
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyzerner committed Jun 25, 2023
1 parent 89f23df commit 356e028
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/alerts/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 356e028

Please sign in to comment.