Skip to content

Commit 5570353

Browse files
committed
Use a proper namespace for the event
1 parent 467ca18 commit 5570353

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ts/WoltLabSuite/Core/Component/Snackbar.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class Snackbar extends EventTarget {
117117
return;
118118
}
119119

120-
this.dispatchEvent(new CustomEvent("close"));
120+
this.dispatchEvent(new CustomEvent("snackbar:close"));
121121

122122
// The animation to move the element vertically relative to its height
123123
// requires the value to be computed first.
@@ -138,7 +138,7 @@ class Snackbar extends EventTarget {
138138
}
139139

140140
interface SnackbarEventMap {
141-
close: CustomEvent<void>;
141+
"snackbar:close": CustomEvent<void>;
142142
}
143143

144144
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
@@ -182,7 +182,7 @@ class SnackbarContainer {
182182
this.#snackbars.push(snackbar);
183183
this.#element.prepend(snackbar.element);
184184

185-
void snackbar.addEventListener("close", () => {
185+
void snackbar.addEventListener("snackbar:close", () => {
186186
const i = this.#snackbars.indexOf(snackbar);
187187
if (i !== -1) {
188188
this.#snackbars = this.#snackbars.splice(i, 1);

wcfsetup/install/files/js/WoltLabSuite/Core/Component/Snackbar.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)