fix: cast cloneNode to DocumentFragment for firstElementChild access

This commit is contained in:
2026-05-13 13:35:53 +02:00
parent 846fe9ccd9
commit d00f9493af

View File

@@ -29,7 +29,7 @@ const showToast = ({ message, duration = 3000 }: ToastOptions): void => {
return;
}
const toast = template.content.cloneNode(true).firstElementChild as HTMLElement;
const toast = (template.content.cloneNode(true) as DocumentFragment).firstElementChild as HTMLElement;
if (!toast) return;
const messageEl = toast.querySelector('.toast-message');
const closeBtn = toast.querySelector('.toast-close');