proposal:
It should be possible to change the Snackbar content while it is open and visible instead of closing it and opening it again with new content
expected behavior:
once an instance of Snackbar is opened and application decided to change the content (for example number of selected items or any other dynamic variable), it should be possible to pass new content and update its content without closing it and opening it again an again
current behavior:
currently if I want to change the content I should use MatSnackBar.open('new message', snackBarConfig) which closes the currently open Snackbar and open it again
use-case or motivation for changing an existing behavior:
Imagine you have a constantly changing variable like line distance on a map and with each user interaction you want to update the measured distance. it is very annoying to open an close each time user change the distance measurements
This is already possible with openFromComponent. Just use a service to communicate between with the snackbar component.
https://stackblitz.com/edit/material2-beta12-mlvrtq?file=app%2Fapp.component.ts
Closing as duplicate of #7323
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
This is already possible with
openFromComponent. Just use a service to communicate between with the snackbar component.https://stackblitz.com/edit/material2-beta12-mlvrtq?file=app%2Fapp.component.ts