Bug: Snackbar missing public action method for custom snackbars
See original GitHub issueBug, 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
observable
What 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 dismiss
What 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
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Snackbar from custom class not showing - Stack Overflow
Thx to Mike M. I solved it like this: In MyActivity added private static CoordinatorLayout mCoord; mCoord = findViewById(R.id.
Read more >Snackbar - Android Developers
Snackbars automatically disappear after a timeout. They can also be dismissed by being swiped off screen, by action click, ...
Read more >Bunifu Snackbar - Bunifu Framework Docs
This is the method responsible for displaying a Bunifu Snackbar during runtime. ... "I have a custom call back when action button is...
Read more >Snackbar - MudBlazor - Blazor Component Library
Custom Action Handling ... A snackbar becomes clickable when a handler is defined in the OnClick property of the SnackbarOptions object. ... Alternatively,...
Read more >Theming Material Design Snackbars in Android with Example
This method is done using the styles.xml file. Where we need to override the default style of the Snackbar. Have a look at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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. 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.