Open
Conversation
RylanBot
commented
Feb 9, 2026
| } | ||
| }; | ||
|
|
||
| const onResize = useDebounce(() => { |
Collaborator
Author
There was a problem hiding this comment.
使用 debounce 会导致 resize 时肉眼可见的闪烁
Collaborator
TDesign Component Site Preview Open
|
commit: |
fb2f9d1 to
6f63c48
Compare
6f63c48 to
8707f69
Compare
RylanBot
commented
Feb 12, 2026
| container | String / Function | () => (() => window) | 指定滚动的容器。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:`ScrollContainer`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N | ||
| content | TNode | - | 内容。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/packages/components/common.ts) | N | ||
| offsetBottom | Number | 0 | 距离容器顶部达到指定距离后触发固定 | N | ||
| offsetBottom | Number | - | 距离容器顶部达到指定距离后触发固定 | N |
Collaborator
Author
There was a problem hiding this comment.
offsetTop 和 offsetBottom 会冲突,理论上只能二选一
| scrollContainer.current.addEventListener('scroll', handleScroll); | ||
| window.addEventListener('resize', handleScroll); | ||
|
|
||
| // 当 container 不是 window 时,也需要监听 window 的 scroll 事件 |
Collaborator
Author
There was a problem hiding this comment.
监听 window 直接交给组件库内部处理更合理吧...
| // 存在纵向滚动条,且固定表头时,需去除滚动条宽度 | ||
| const reduceWidth = isFixedHeader ? scrollbarWidth : 0; | ||
| // 去除滚动条宽度 | ||
| const reduceWidth = isWidthOverflow ? scrollbarWidth : 0; |
Collaborator
Author
There was a problem hiding this comment.
(日志 2➕3)affix 不对齐、empty 不居中等情况都是这里造成的
af94117 to
7d50ad5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
Table + Dialog + 虚拟滚动叠加使用例子
📝 更新日志
tdesign-react
empty宽度比表格还大的问题Dialog内,吸顶表头、吸底表尾、吸底滚动条与表格对齐不稳定的问题@tdesign-react/chat
☑️ 请求合并前的自查清单