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.

Bug: Snackbar missing public action method for custom snackbars

See original GitHub issue

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 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jelbourncommented, Jul 11, 2017

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.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

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