From d00f9493af3724c2d4c207a89b48062417936693 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Wed, 13 May 2026 13:35:53 +0200 Subject: [PATCH] fix: cast cloneNode to DocumentFragment for firstElementChild access --- static/toast.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/toast.ts b/static/toast.ts index 04bec74..469ad10 100644 --- a/static/toast.ts +++ b/static/toast.ts @@ -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');