feat(SnackBar): allow to define a container in which to render the snackbar
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
#### 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.
コントリビューションガイド
調査の方向性
リンクされた StackBlitz の再現から始め、MatSnackBarConfig.viewContainerRef を調べ、要求された .basic-container の配置とその動作を比較します。選択したコンテナ内で SnackBar を viewport ではなくレンダリングして配置できる設定があれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100