angular / angular/components

Mat-table with multiTemplateDataRows is not working when this table is added in mat-tab.

未关闭
#15,775 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area: material/table P2
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

#### What is the expected behavior?
it should work fine with/without mat-tab

#### What is the current behavior?
Empty rows are created and displaying

#### What are the steps to reproduce?
Providing a StackBlitz reproduction is the *best* way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

Step 1: Go to "https://stackblitz.com/edit/angular-material-expandable-table-rows?file=app%2Ftable%2Ftable.component.ts"

Step 2: Add Mat-tab module in app.module.ts "import {MatTabsModule} from '@angular/material/tabs';"

Step 3: Add the following code at the top, in table.componenet.html

"
Content 1
Content 2
Content 3
"

Step 4: Cut the rest of the code and paste it inside the tab replacing "Content 1"

Step 5: run the code.

Step 6: move to next tab and come back to first tab, the content will be displaying by default. PFA screenshots
![codechanges](https://user-images.githubusercontent.com/40624122/55858472-684e7780-5b8d-11e9-9b85-771dd0b99762.png)
![issue](https://user-images.githubusercontent.com/40624122/55858481-6edcef00-5b8d-11e9-8279-392a77220315.png)

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

#### Is there anything else we should know?

贡献指南

打开贡献指南

调研方向

从 StackBlitz 复现开始,在将表格放入 mat-tab 前后分别比较 table.component.html 和 table.component.ts。检查 app.module.ts 中是否有 MatTabsModule,然后通过切换选项卡复现空行问题。完成标准是:离开第一个选项卡并返回后,multiTemplateDataRows 表格仍能正确显示其内容。

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

评估

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

把新 issue 发到你的邮箱

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