-
-
Notifications
You must be signed in to change notification settings - Fork 48
distinction between automatic closing and user action #104
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
Conversation
Hey, continuing from #105, I understand the need to differentiate between dismiss by timeout, or user-action. It probably makes more sense to return a IMHO, the const { id, val } = await toast.push('hello world!') I'm been waiting (for a year now 😅) for Svelte's I'll probably merge this in first and refactor it to return a |
hi, I can change that to detail object in my pull request it that helps :) |
Great. Can you also run |
I've made changes and run |
That's ok - thanks so much for your contribution! |
Thank you. On the side note: maybe it's also a good time to update dependencies to newer versions? |
Yes I'm on it! 😄 |
Hey @dominikcz, hope you don't mind that I made some changes, mainly because I wanted to avoid polluting the toast.push('Hello world', {
onpop: (id, details) => {
// `details.event` contains the mouse or keyboard event
// and is `undefined` if the toast closes by timeout
}
}) |
Hi, I don't mind at all, |
HI, I have a case where I have to make a distinction between situations when user clicks a toast in order to close it and another one, when toast autocloses. That's why I propose additional (optional) parameter to onpop callback.
onpop: (id, ev) => {}
When it autocloses ev is undefined. In other cases it is original event (mouse click, touch or key press).