Unable to Prevent Toast Close Using event.preventDefault() in Action Button Callback #34
Open
1 of 2 tasks
Labels
bug
Something isn't working
Please provide the environment you discovered this bug in.
ngx-sonner: 2.0.2
angular: 18.2.11
angular-cdk: 18.2.11
Description
Hello, I am on version 2.0.2, and while reading the documentation about action buttons, it says:
I am trying to replicate this, but the sonner still closes, not work. Am I doing something wrong? I thought the event came from onClick, but it doesn’t have any parameters.
toast('Invalid form', {
description: 'Please check the fields marked in red',
cancel: {
label: 'Ok',
onClick: () => {
event?.preventDefault();
},
},
position: 'top-right',
duration: 4000,
});
Thanks for this amazing library!
Please provide the exception or error you saw
No response
Other information
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: