Skip to content

Commit

Permalink
fix: πŸ› now closeButton works as expected
Browse files Browse the repository at this point in the history
add qrl wrapper to execute the user `onDismiss$` function and also change the logic in the onClick$ attribute in `Toast` component

this commit solves the #10 issue
  • Loading branch information
diecodev committed May 22, 2024
1 parent 7f4200f commit a66058d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/headless/toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,7 @@ export const Toast = component$<ToastProps>((props) => {
onClick$={
disabled || !dismissible
? () => {}
: () => {
deleteToast();
toast.onDismiss$?.(toast);
}
: [deleteToast, $(() => toast.onDismiss$?.(toast))]
}
class={[classes?.closeButton, toast?.classes?.closeButton]}
>
Expand Down

0 comments on commit a66058d

Please sign in to comment.