angular / angular/components

Pagination controls for mat-tab-group do not appear when used with the mat-sidenav

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

描述

I am trying to use the mat-sidenav with the mat-tab-group and there appears to be an issue with the pagination controls for the mat-tab-group. The test app will create 3 default tabs. If you add enough tabs so that there is just enough space to show the tabs without the tab pagination controls being displayed (based on your screen width), then open the sidenav by clicking the Toggle Sidenav button, the pagination controls do not appear in the tab control. Clicking the Add Tab button to add one more tab will force the tab control to reevaluate the horizontal space and then display the pagination controls for the tab control.

It appears that that the tab control is not aware that the horizontal space has decreased, because the sidenav is open, and does not show the pagination controls. The opposite is also true that if the pagination controls are displayed when the sidenav is open, when the sidenav is closed and there is enough horizontal space that the tab control no longer needs the pagination controls they do not disappear.

The desired behavior would be that the tab control will display or not display its pagination controls when necessary as the sidenav is open and closed.
```



Sidenav







Toggle Sidenav
Add Tab




Tab content for {{tab.label}}






```

```
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
tabs: any[] = [{label: "tab1"}, {label: "tab2"}, {label: "tab3"}]

addTab() {
this.tabs.push({label: "tab" + (this.tabs.length + 1)})
}
}
```

贡献指南

打开贡献指南

调研方向

从提供的使用 mat-sidenav 和 mat-tab-group 的测试应用开始,通过在标签页分页阈值附近切换 sidenav 来复现布局变化。跟踪标签页组如何响应水平空间的缩小和恢复;当打开和关闭 sidenav 时,其分页控件能够正确出现和消失即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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