Skip to content

Commit

Permalink
Fix inability to prevent toast from closing on action button click (#484
Browse files Browse the repository at this point in the history
)
  • Loading branch information
iuriiiurevich authored Nov 2, 2024
1 parent 5159aec commit 8d33b51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down

0 comments on commit 8d33b51

Please sign in to comment.