Open nevir opened 10 years ago
bump
Was just about to open an issue and came across this. @nevir was your suggestion manage to get through to paper-toast?
When two or more paper-toasts are fired, they overlap. I realized they don't queue or stack vertically on top of each other.
Any workaround? Thanks
As said in Summary :
There's a fundamental issue here! If only one is allowed on the screen (reasonable to me), then triggering a new toast message while one is already opened should do something intuitive. Right now, it simply dismisses the opened one. That makes no sense to me from a UX standpoint.
IMO, best would be that it dismisses the opened one and slides in a new one. Intuitive!
Click "Send message" then quickly again: https://www.polymer-project.org/0.5/components/paper-toast/demo.html
UPDATE: This seems to work for me, namely wait for the toast to close before trying to open a new one:
void showMessage(String message, [String severity]) {
PaperToast toastElement = document.querySelector('woven-app').shadowRoot.querySelector('#toast-message');
if (toastElement == null) return;
if (toastElement.opened) toastElement.opened = false;
new Timer(new Duration(milliseconds: 300), () {
if (severity == "important") {
toastElement.classes.add("important");
} else {
toastElement.classes.remove("important");
}
toastElement.text = "$message";
toastElement.show();
});
}
What's the current status on this?
@krozycki You might find information in the Google Material Design Guide
It states:
Snackbars automatically time out from the screen. For usability reasons, snackbars should not contain the only way to access a core use case. They should not be persistent or be stacked, as they are above other elements on screen.
Should the toasts queue up for display? First wins? Last wins (current behavior)? other?
I'm willing to help out & implement support for this; but am not sure what the proper behavior is :( The spec doesn't seem to have words about it, either.