Programmatically dismissing all toast messages created by Materialize.toast(...)
Hello,
I am looking for a way to programmatically dismiss all toast messages created by Materialize.toast(...).
In my single page app, I want to dismiss all toasts displayed to the user when user navigates to a different page without dismissing toasts. Basically what I am looking for is a Materialize.toast.dismissAll() kind of method. I searched and looked for help but could not figure out a legitimate way to do this (discounting the hacks). Is there a way to do this, and if not, I would like to propose a feature that allows this.
Thanks
:+1: this needs to be documented
The implementation should return a handler as such :
const toast = Materialize.toast('I am a toast', 30000);
toast.isActive(); // true if the toast is still visible, false if it was dismissed or has timed out
toast.dismiss(); // dismiss the toast
Any progress on this?
Added in 87373d6b4551917e9b6d5b96afd031d521a8a285