From 8d33b51ebb999b6f98a71d32ee012d698c306f83 Mon Sep 17 00:00:00 2001 From: Yury Demin Date: Sat, 2 Nov 2024 18:46:02 +0300 Subject: [PATCH] Fix inability to prevent toast from closing on action button click (#484) --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 7df9d76..0b1fb77 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -405,8 +405,8 @@ const Toast = (props: ToastProps) => { onClick={(event) => { // We need to check twice because typescript if (!isAction(toast.action)) return; - if (event.defaultPrevented) return; toast.action.onClick?.(event); + if (event.defaultPrevented) return; deleteToast(); }} className={cn(classNames?.actionButton, toast?.classNames?.actionButton)}