angular / angular/components

feat(SnackBar): allow to define a container in which to render the snackbar

Aperta
#7,764 12 commenti 26 reazioni 0 assegnatari Vedi su GitHub
area: material/snack-bar feature needs: discussion P5
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### Bug, feature request, or proposal:
feature request

#### What is the expected behavior?
There should be a setting to define a container in which the snackbar is positioned in.

#### What is the current behavior?
SnackBar is always positioned based on the viewport.

#### What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-ddtruw

#### What is the use-case or motivation for changing an existing behavior?
I have an app with a static main toolbar at the top. When i position the snackbar to "top right" it will be shown above the main toolbar (see stackblitz example). I would like it to be shown at the top right of the container below the main toolbar (".basic-container" in my stackblitz example).

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
angular 4.4.2
angular-material 2.0.0 - Beta12
Chrome 61.0.3163.100

#### Is there anything else we should know?
MatSnackBarConfig has a viewContainerRef property. At first i thought this would be exactly what i need but when i tried to change it, it didn't seem to do anything. In the documentation of the MatDialog component (which also has a viewContainerRef property) it is stated that this property does not affect the place where it is rendered. I assume the same goes for MatSnackBar.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione StackBlitz collegata e analizza MatSnackBarConfig.viewContainerRef, confrontandone il comportamento con il posizionamento richiesto di .basic-container. Il lavoro è completato quando un'impostazione consente di eseguire il rendering e il posizionamento della SnackBar all'interno del container scelto anziché nel viewport.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.