I'm currently working with Material Design's Snackbar in combination with VueJS. My goal is to detect when the snackbar has finished closing.
The Snackbar object does have a property called isOpen, which allows me to check if the snackbar is open by using return this.snackbar.isOpen;
. However, there isn't an equivalent property like isClosed
, and even after the snackbar closes, the value of isOpen
remains true.
It appears that the isOpen
property only reacts to opening events and not to closing events. I am looking for a solution that will trigger an event when the snackbar finishes closing after being open. Any suggestions are greatly appreciated.
This is how I initialize my snackbar:
this.snackbar = new MDCSnackbar(document.querySelectorAll(".mdc-snackbar"));