-
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
md-snackbar (toast) #115
Comments
Status update: |
Closing this since we have an initial version |
As Material Design specification says, a SnackBar may or may not have an action. There any way to add a SnackBar without any action for now? @angular/material 2.0.0.alpha.9-3 |
@AlvaroOrduna I was able to add an actionless SnackBar by passing |
Duration doesn't work with me, it doesn't even exist in the config class |
@mhmo91 I don't think build with the duration property has been pushed to the npm feed yet. The commit in question was only made just under a couple of weeks ago. |
I have a suspicion that the viewContainerRef setting of MdSnackBarConfig is not working correctly. I have a component (let's call it CompanyComponent) that consists of one MdCard with a button inside of it. Pressing the button opens an MdSnackBar. Since each card has a button that opens a snack bar I want the snack bar to be anchored to the bottom of each card. Multiple instances of the CompanyComponent appear in the parent, AppComponent. I open the snack bar using the following code:
I confirmed in the debugger that this.card is defined and assigned a correct ViewContainerRef object. Once again, I am trying to open the snack bar at the bottom of each card. However, the snack bar opens at the bottom of the browser view port instead (in the AppComponent, not attached to any individual instance of CompanyComponent or MdCard inside of it). Am I doing something wrong, or does there seem a to be a bug? |
@cheresier That's not what |
@jelbourn, a-ha! Got it. Thank you! Can you point to any other material component I should be using for this use case? |
You may just want make your own component and conditionally show/hide it at the bottom of the card. |
How would you control the position of the snackbar? I can see in the sample it is appearing just in the bottom. How would you display it in the right top corner ? And also how would you stack the multipe snackbars appearing on the screen? |
@kuncevic See this comment above. I don't think the position of the snackbar is exposed to the end developer because the material spec doesn't allow it. |
Just went thorugh this https://material.io/guidelines/components/snackbars-toasts.html
So what I was asking for above is actually against the material spec. @jesselpalmer thanks for pointing that out. |
On tablet/desktop the material spec does allow for some variation in position:
Are there any plans to support the bottom/left alignment? |
@MikeMatusz brings up a good point, the snackbar can be positioned in the bottom left on Desktop/Tablet. Should there be a new issue for that functionality? |
@MikeMatusz and @ethanmick do you think your last two comments should be moved to a new issue since this issue doesn't actually refer to the position and has been closed. Wondering if it won't get noticed, but is a case that needs to be addressed. |
@mtpultz Good call, I'll create one right now. |
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. |
https://www.google.com/design/spec/components/snackbars-toasts.html
Depends on #113
The text was updated successfully, but these errors were encountered: