angular / angular/components

bug(table): Table with sticky header 'jumping'

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

描述

### Is this a regression?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When scrolling, a table with a sticky header "jumps" if you add an element that has a absolute position. For example, if you display the tooltip and scroll, then the sticky header will change position for a short time.
This is also true with the mat-progress-bar element.

### Reproduction

StackBlitz link:
Steps to reproduce:
1. Open [link](https://stackblitz.com/edit/gatzhq-oe6hfq?file=src%2Fexample%2Ftable-sticky-header-example.ts)
2. The sticky header changes the position on scroll when there is another element on the page with absolute position

https://github.com/angular/components/assets/16895663/bf5172c5-8cba-4a0b-b5da-89afab55d7ee

### Expected Behavior

The sticky header should not change position on scroll when there is another element on the page with an absolute position

### Actual Behavior

The sticky header changes the position on scroll when there is another element on the page with absolute position

### Environment

- Angular: v12, v15, v16
- CDK/Material: v12, v15, v16
- Browser(s): **Chrome Version 114.0.5735.110 (Official Build) (64-bit)**
- Operating System (e.g. Windows, macOS, Ubuntu): **Windows**

贡献指南

打开贡献指南

调研方向

从链接的 StackBlitz 复现开始,确认在存在 tooltip 或 mat-progress-bar 时滚动会导致 sticky-header 跳动。然后追踪 Angular components repository 中表格 sticky-header 的实现及相关测试。当存在另一个绝对定位的元素时,滚动过程中表头仍保持稳定,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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