-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Snackbar missing public action method for custom snackbars #5657
Comments
Looks like this was done intentionally #1826 (comment), but your use case absolutely makes sense. |
Good point. I would change the method name to |
@willshowell @jelbourn is there any reason not to send a value back through to |
Snackbars are meant to provide a notification with exactly one optional action. Adding the option for getting data from a snackbar would go against the intended use of the component per Material Design spec. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Be able to close a custom snackbar using a public method to indicate action was used, and allow for use of
onAction
observableWhat is the current behavior?
When you create a custom snackbar using
openFromComponent
you can pass in a snackBarRef and invoke any methods on self, but there is no public version of_action()
so if you create a component and a user clicks your action you have to use a private method to be able to distinguish an action/dismiss or just a dismissWhat are the steps to reproduce?
N/A missing API call
What is the use-case or motivation for changing an existing behavior?
Snackbar's have two ways they can be closed, but right now in order to use the
onAction
observable you need to invoke a private method_action()
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 4.2.5, Angular Materila 2.0.0-beta.8, Windows 10
The text was updated successfully, but these errors were encountered: