-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
How to distinguish autoClose from manual dismiss #1000
Comments
If you listen for the onChange event on toast it returns a ToastItem payload. Inside of it you can check the toast status property . When you click inside the toast, close the toast with x and on toast autoClose they ALL return status : removed in my case there is no way for me to reproduce the onClick event which was working only when you click inside the toast and not on the x button. In your case its the onClose that has the same status. here is the link to try it out yourself : https://fkhadra.github.io/react-toastify/listen-for-changes |
Hey, I've released the v11, it is not longer required to import the css file. Please read the release note before upgrading 🙏🏽 .See https://fkhadra.github.io/react-toastify/define-callback for your use case |
I'm struggling to remove toasts from Notification Center, that were manually closed (with close button click).
However, in onClose there is no way to distinguish wether the toast was closed automatically (via timeout) or by user action (close button click).
Tried with custom button, but the button does not receive any toast related properties, so there is no way to dismiss related toast from notification center in button's onClick event.
Any help would be appreciated.
Thank you
The text was updated successfully, but these errors were encountered: