Skip to content

Conversation

@RylanBot
Copy link
Collaborator

@RylanBot RylanBot commented Oct 18, 2025

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • fix(Table): 修复页面滚动时,自定义 container 的吸顶表头或表尾无法与表格对齐的问题

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 18, 2025

tdesign-react-demo

npm i https://pkg.pr.new/tdesign-react@3899

commit: e0eac3d

@RylanBot RylanBot changed the title Rylan/fix/table/affix fix(Table): improve horizontal scroll handling for fixedRows and affixed header Oct 18, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2025

失败

@RylanBot RylanBot requested a review from Copilot October 18, 2025 14:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes horizontal scroll handling issues when using fixedRows with affixed header in the Table component. The main problem was that when the page scrolls horizontally, the affixed header and table content would become misaligned.

  • Adds page-level horizontal scroll handling for fixedRows with sticky positioning
  • Improves scroll state tracking using useRef instead of local variables
  • Updates condition checks to include virtual scroll in affix logic

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.

File Description
packages/components/table/hooks/useAffix.ts Core fix adding page horizontal scroll listener and improving scroll tracking
packages/components/table/_example/fixed-header-col.tsx Removes unused channel column from demo data
packages/components/table/_example/fixed-column.tsx Updates demo with scroll button and improved layout

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@RylanBot RylanBot added the WIP work in porgess label Oct 18, 2025
@RylanBot RylanBot force-pushed the rylan/fix/table/affix branch from 73f2798 to 90c00ae Compare October 20, 2025 03:36
@RylanBot RylanBot removed the WIP work in porgess label Oct 20, 2025
@RylanBot RylanBot changed the title fix(Table): improve horizontal scroll handling for fixedRows and affixed header fix(Table): improve page scroll handling for affixed header Oct 20, 2025
@RylanBot RylanBot changed the title fix(Table): improve page scroll handling for affixed header fix(Table): improve page scroll handling for affixed header and footer Oct 20, 2025
@RylanBot RylanBot added the WIP work in porgess label Oct 20, 2025
@RylanBot RylanBot force-pushed the rylan/fix/table/affix branch from 6d35082 to 1cbc230 Compare October 21, 2025 02:30
@RylanBot
Copy link
Collaborator Author

RylanBot commented Oct 21, 2025

修复前:

renderHeaderContentreaderFooterContentuseMemo 缓存了

2025-10-21.12.37.45.mp4

修复后:

自定义 container 时垂直滚动依赖 Affix 底层逻辑...目前看来有延迟,有明显运动轨迹,未来需要优化 Affix

2025-10-21.12.36.43.mp4

@RylanBot RylanBot removed the WIP work in porgess label Oct 21, 2025
@RylanBot RylanBot added the WIP work in porgess label Oct 23, 2025
@RylanBot RylanBot removed the WIP work in porgess label Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants