-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(alert): update alert queue when an alert is removed from the DOM (#…
…7189) **Related Issue:** #6616 ## Summary - Adds new internal event `calciteInternalAlertUnregister` to dispatch when an alert is removed from the DOM. - Event is dispatched on the window since that is where the listeners are and dispatching on the element won't reach the window since the element would no longer be in the DOM. - When the event is received, the queue is updated to remove the removed alert element. - queue is kept n'sync. ![giphy](https://github.com/Esri/calcite-components/assets/1231455/691e1744-6045-48b2-8e55-97479a2b8a5b)
- Loading branch information
Showing
3 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/calcite-components/src/components/alert/interfaces.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
export type AlertDuration = "fast" | "medium" | "slow"; | ||
|
||
export interface Sync { | ||
queue: HTMLCalciteAlertElement[]; | ||
} | ||
|
||
export interface Unregister { | ||
alert: HTMLCalciteAlertElement; | ||
} |