I'm using Material Design's Snackbar and VueJS and I'd like to be able to detect when the snackbar has closed.
Snackbar has a built in property called isOpen, so I'm able to use return this.snackbar.isOpen;
as a boolean. However, there isn't a similar isClosed
property, and when the snackbar does close, isOpen
remains true.
It seems that isOpen
is not reactive to closing, just to opening. But I want something to trigger when the snackbar is closes after having been open. Would appreciate any advice
I init my snackbar like so:
this.snackbar = new MDCSnackbar(document.querySelectorAll(".mdc-snackbar"));