Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inability to prevent toast from closing on action button click #484

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iuriiiurevich
Copy link

Issue:

Closes #172 (comment)

This PR restores the ability to prevent a toast from closing when action button is clicked by using event.preventDefault() in the onClick callback.

The current behavior does not honor onClick's event.preventDefault(), which was unintentionally broken by 7d28d42.

The intended behavior is stated in the documentation:

You can prevent the toast from closing by calling event.preventDefault() in the onClick callback.

What has been done:

  • Moved onClick call before the defaultPrevented check

Screenshots/Videos:

N/A

Copy link

vercel bot commented Aug 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sonner ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 26, 2024 6:19pm

@iuriiiurevich
Copy link
Author

@emilkowalski

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Action button shouldn't close toast
1 participant