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.

MatSnackBarConfig.viewContainerRef is not honored

See original GitHub issue

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When MatSnackBar.open is called with a MatSnackBarConfig like

{
  ...
  viewContainerRef: myContainerRef
  ...
}

according to the documentation:

viewContainerRef: ViewContainerRef       The view container to place the overlay for the snack bar into.

it’s overlay of the snackbar should be placed inside the provided container ref.

What is the current behavior?

It’s attached directly to <body>

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-1jgbvq

What is the use-case or motivation for changing an existing behavior?

I want to show the snackbar inside of a container and not globally

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 5.2.9 Material: 5.2.5 OS: MacOS v10.13.3 TypeScript: 2.4.2 Browser: Chrome v65.0.3325.181

Is there anything else we should know?

Nope

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

14reactions
cl0udninjacommented, May 3, 2018

@josephperrott Can you at least update the ambiguous documentation? Because the documentation says the place in the logic tree, it says ‘The view container to place the overlay for the snack bar into.’ And that’s totally not happening.

7reactions
michelcvecommented, Jul 9, 2018

@josephperrott I would vote for a documentation change as well. Got fooled by the current documentation as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to open angular/Material2 Snackbar on especific ...
Yes. The viewContainerRef property of MatSnackBarConfig will accept a ViewContainer to use as a place ...
Read more >
Snackbar - Angular Material
open. Opens a snackbar with a message and an optional action. Parameters. message. string. The message to show in the snackbar. action. string...
Read more >
Open snackbar into a specific container? - Google Groups
I'm working on a dashboard app where each view may have several components. ... I am admittedly not well versed with view container...
Read more >
base-with-mat - UNPKG
If the tabs are not ready yet, we assume that the user is\n * providing a valid ... false;\n\n constructor(private _viewContainerRef: ViewContainerRef) {\n ......
Read more >
Falcon Sandbox v8.30 © Hybrid Analysis
Not all malicious and suspicious indicators are displayed. ... Uses a User Agent typical for browsers, although no browser was ever launched.
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