-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Correlate a Toast with the one which has Just Hidden #675
Comments
Have you tried looking at the code on the demo page. There is a black/gray bar in the bottomif you click on it you'll see what they call glimpse. If you fire a toast you will see it appear in the glimpse, you'll also see it there when it dissappears. This javascript file has some features which may help you for example
By subscribing a function to the toast it'll trigger on completion. I have my doubts if this works onclick though. The code in the function pushes the toast to the preexistingToasts when its not being rendered anymore. I hope this hint can help you achieve your goal (this isn't a complete tutorial i suggest reading and understanding the code in the javascript file). |
It would be good if the onHidden callback passed a parameter enabling the executing code to identify which Toast was being hidden.
Currently, there's no way to correlate a toast that is hiding/hidden.
In the scenario I am facing, I am pushing each message into a MessageBoard at the top of the page as the onHidden handler fires.
But they may hide in a different order that that in which they are launched.
For example, a user may hover over one Toast, meaning that a Toast which came after it hides before it.
This messes up the order in which messages are added to the message board.
As a work around, I'm now adding them to the board as the Toast is launched. But it would be more elegant to add it when the Toast disappears.
Cheers
The text was updated successfully, but these errors were encountered: