You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I have opened some persistent dialog with this.$dialog.showAndWait() and then accidentally press "back" in the browser or on my mouse (the side buttons) -- the route changes to the previous one, but the dialog won't close an is still on the screen. Is there any programmatic, "native" way to handle this situation and close the dialog on route change?
Duplicate of #64 Clear all dialogs and notifications
I managed to do it using the shown and destroyed events to keep track of the dialogs.
let_dialogs=[]Vue.prototype.$dialog.on('shown',({ dialog })=>_dialogs.push(dialog))Vue.prototype.$dialog.on('destroyed',({ dialog })=>(_dialogs=_dialogs.filter((_dialog)=>_dialog.id!==dialog.id)))Vue.prototype.$dialog.clearDialogs=()=>{_dialogs.forEach((_dialog)=>_dialog.remove())_dialogs=[]}// Then you can call this.$dialog.clearDialogs() inside any component
Say I have opened some persistent dialog with
this.$dialog.showAndWait()
and then accidentally press "back" in the browser or on my mouse (the side buttons) -- the route changes to the previous one, but the dialog won't close an is still on the screen. Is there any programmatic, "native" way to handle this situation and close the dialog on route change?Right now I'm doing it like this:
from inside the dialog's component.
Or maybe there's some global method to close all open dialogs?
Thank you.
The text was updated successfully, but these errors were encountered: