Repository navigation
Conversation
lnuxe
requested review from
HaixingOoO,
NWYLZW,
RylanBot,
ZWkang,
carolin913,
honkinglin and
uyarn
as code owners
November 12, 2026 09:57
useTreeDataExpand seeded the uncontrolled expanded state from
props.defaultSelectedRowKeys:
defaultExpandedTreeNodes: props.defaultSelectedRowKeys || [],
So a table that only set defaultSelectedRowKeys also expanded those rows, and
a table that set defaultExpandedTreeNodes saw it ignored entirely.
Verified:
- new test fails on the previous implementation
(expected [ '0', '1' ] to deeply equal [ '0', '0-0', '0-1', '1' ])
- new test passes with the fix
- the second case confirms defaultSelectedRowKeys no longer expands anything
lnuxe
force-pushed
the
fix/table-default-expanded-tree-nodes
branch
from
November 13, 2026 03:03
0806944 to
132cbc4
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
无(本 PR 直接修复
defaultExpandedTreeNodes失效)📝 描述
useTreeDataExpand把错误的 prop 当成了非受控默认值:后果有两个方向:
defaultExpandedTreeNodes完全失效——传了也不会展开任何节点defaultSelectedRowKeys会意外展开树节点这两个 prop 毫无关系,一个是展开的节点列表,一个是选中的行列表。
改动
🔍 自测
修复前(还原
useTreeDataExpand.ts后跑新测试):修复后:
第二个用例专门锁住反向行为:只传
defaultSelectedRowKeys时不应展开任何节点。回归:
✅ 贡献者检查