Snackbar notification leaves message on page
Bug:
When I invoke Snackbar, the message appears both in a floating box and as text, just above the snackbar.

After the snackbar disappears, the text remains on the page.
What is the expected behavior?
When the snackbar is invoked, the text that appears on the page should not be shown.
Which versions of Angular, Material, OS, browsers are affected?
"angular-cli": "^1.0.0-beta.24" "hammerjs": "^2.0.8", "@angular/core": "^2.3.1", "@angular/forms": "^2.3.1" "@angular/material": "^2.0.0-beta.1"
Chrome
Is there anything else we should know?
I created a service: `@Injectable() export class NotificationService { private _snackBarConfig: MdSnackBarConfig;
constructor(public snackBar: MdSnackBar) {
this._snackBarConfig = new MdSnackBarConfig();
this._snackBarConfig.duration = 10000;
}
public callSnackBar(message: string) {
this.snackBar.open(message, null, this._snackBarConfig);
}`
Then, when I call it: `this._msgNotification = "The system did not return any " + "tenants. You're session may have expired. Please login, again.";
this._notifService.callSnackBar(this._msgNotification);`
One of those texts is supposed to be hidden and used to announce the snack bar to screen readers. Are you sure that you followed the theming guide and included all of the necessary CSS?
@crisbeto , I haven't had a chance to implement a theme. Is it really required, then?
It is, because it provides some of the core styles, e.g. the backdrops will be transparent if you don't provide one. There are some pre-built ones that are distributed with the Material releases.
@crisbeto , so, taking the example, how do i reference the theme in the template? is it as simple as (app.component.html):
<div class="candy-apple-theme">
angular stuff here
</div>
You don't need to reference, you just include it as a regular CSS file somewhere in your HTML.
i'm using angular-cli. according to the example, you save it as a SASS file....don't do this?
Via the theming guide:
If you're using Angular CLI, this is as simple as including one line in your style.css file:
@import '~@angular/material/core/theming/prebuilt/deeppurple-amber.css';
@crisbeto , thanks for the help. I'm implementing the theme, now. and i'm still seeing that text left by the snackbar notification!
Cool, glad to help. I'll consider this one resolved.
yes. consider it resolved. there should be some explanation on Snackbar that theming is required.
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.