question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow MatSnackBarRef to be closed with an ActionValue

See original GitHub issue

Currently the Snackbar can only be dismiss’ed or dismissWithAction’ed. And the action cannot be passed! So if I have more than one action I need to store the result in a static scope (or am I mistaken?). Wouldn’t it make much more sense to just have a dismiss-method with an optional value parameter? Like the MatDialog has?

This dismiss / dismissWithAction thing really feels dusty …

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
crisbetocommented, Oct 5, 2021

I’ll add this for discussion in our next team meeting.

1reaction
crisbetocommented, Oct 5, 2021

I think that it limited on purpose, because snack bars are meant primarily for simple pieces of information that go away automatically after a certain amount of time, not for passing data around.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to dismiss/close an Angular Snackbar element from ...
You can do the following to achieve this. This snack-bar is like a mat-dialog .. you have to call the dismiss() on a...
Read more >
Snackbar | Angular Material
In either case, a MatSnackBarRef is returned. This can be used to dismiss the snackbar or to receive notification of when the snackbar...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found