Closed sysebert closed 4 years ago
The onActionClick
hook actually receives the snackbar as an argument (reference).
So you can do:
this.$refs.snackbarContainer.createSnackbar({
message: 'Some message',
action: 'Close',
onActionClick: (snackbar) => {
snackbar.show = false; // Hide the snackbar
},
});
~This needs to be documented.~ Update: it actually is documented with the createSnackbar()
method 😅.
I'm not sure where in the docs you mean, but this is the page I basically leave in my tabs: https://josephuspaye.github.io/Keen-UI/#/ui-snackbar :)
But, thanks, this is perfect!
I'm looking for a way to dismiss a snackbar using the UiSnackbarContainer. Ideally it'd work the exact same way as hideOnClick does, but be able to do that via a method on the container.
I want to have an action that says "close" trigger the method in the onActionClick handler.
Any tips or tricks would be appreciated!