googlearchive / paper-toast

A lightweight feedback about an operation in a small popup at the base of the screen on mobile and at the lower left on desktop.
17 stars 8 forks source link

What's the proper behavior for multiple toasts triggering together? #2

Open nevir opened 10 years ago

nevir commented 10 years ago

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.

akashkrishnan commented 9 years ago

bump

seanmavley commented 9 years ago

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

amoiseyenko commented 9 years ago

As said in Summary :

There can be only one ( toast ) on the screen at a time.

davenotik commented 9 years ago

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();
    });
  }
krozycki commented 8 years ago

What's the current status on this?

red15 commented 8 years ago

@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.