fix(EnhancedTable): tree nodes being re-collapsed so children only render after scrolling - #4371
Open
RylanBot wants to merge 1 commit into
Open
fix(EnhancedTable): tree nodes being re-collapsed so children only render after scrolling#4371RylanBot wants to merge 1 commit into
RylanBot wants to merge 1 commit into
Conversation
…nder after scrolling
RylanBot
requested review from
HaixingOoO,
NWYLZW,
ZWkang,
carolin913,
honkinglin and
uyarn
as code owners
September 1, 2026 13:25
Contributor
|
Size Change: 0 B Total Size: 115 kB ℹ️ View Unchanged
|
Collaborator
TDesign Component Site Preview Open
|
commit: |
Contributor
|
Size Change: +94 B (+0.01%) Total Size: 932 kB 📦 View Changed
ℹ️ View Unchanged
|
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
💡 需求背景和解决方案
受控模式下,一次点击会触发两个 effect:
useTreeDataExpand的user-reaction-change分支直接调用store.toggleExpandData({ row, rowIndex }, dataSource),以visibleData切片中的局部下标(如3)作为rowIndex,将子节点 splice 到错误位置(如dataSource[4],而非真实的dataSource[51])。useTreeData的useEffect([data, expandedTreeNodes])随后执行resetData,重建 store 并按expandedTreeNodes正确展开节点。由于步骤 1 将子节点插入了视口之外的错误位置,虚拟滚动计算可视区切片时无法包含这些行,直到用户触发滚动重新计算才显现。
(无虚拟滚动时不触发:此时
visibleData === dataSource,局部下标与真实下标一致,splice 位置正确,表现正常)📝 更新日志
tdesign-react
expandedTreeNodes受控时,展开的子节点无法正确渲染的问题@tdesign-react/chat
☑️ 请求合并前的自查清单