diff --git a/src/lib/headless/toast.tsx b/src/lib/headless/toast.tsx index ffab78a..b485a2c 100644 --- a/src/lib/headless/toast.tsx +++ b/src/lib/headless/toast.tsx @@ -364,10 +364,7 @@ export const Toast = component$((props) => { onClick$={ disabled || !dismissible ? () => {} - : () => { - deleteToast(); - toast.onDismiss$?.(toast); - } + : [deleteToast, $(() => toast.onDismiss$?.(toast))] } class={[classes?.closeButton, toast?.classes?.closeButton]} >