angular / angular/components

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

未关闭
#7,764 12 条评论 26 个 reaction 已指派 0 人 在 GitHub 查看
area: material/snack-bar feature needs: discussion P5
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
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 在所选容器内而不是视口中进行渲染和定位。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。