Skip to content

fix(table): read defaultExpandedTreeNodes from its own prop - #4480

Merged
uyarn merged 3 commits into
Tencent:developfrom
lnuxe:fix/table-default-expanded-tree-nodes
Nov 25, 2026
Merged

uyarn merged 3 commits into
Tencent:developfrom
lnuxe:fix/table-default-expanded-tree-nodes

Conversation

@lnuxe

@lnuxe lnuxe commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🤔 这个 PR 的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

📝 更新日志

  • 本条 PR 不需要纳入 Changelog

tdesign-react

  • fix(EnhancedTable): 修复 defaultExpandedTreeNodes 不生效的问题

@tdesign-react/chat

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

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

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

@lnuxe
lnuxe force-pushed the fix/table-default-expanded-tree-nodes branch from 0806944 to 132cbc4 Compare November 13, 2026 03:03
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
lnuxe force-pushed the fix/table-default-expanded-tree-nodes branch from 132cbc4 to f794819 Compare November 17, 2026 02:06
@lnuxe

lnuxe commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

先关掉,收敛一下数量。

本仓库我这边积压的 open PR 偏多,维护者审不过来,反而稀释了每个 PR 的信号。这个修复本身是有效的,分支保留在 fork:fix/table-default-expanded-tree-nodes,需要时可以随时重开。

保留的是影响面更大、或已经有维护者反馈的那几个。

@lnuxe lnuxe closed this Nov 19, 2026
@RylanBot RylanBot reopened this Nov 20, 2026
@lnuxe

lnuxe commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

按收敛计划关闭(无维护者反馈)。分支保留在 fork:fix/table-default-expanded-tree-nodes,需要时可重开。

@lnuxe lnuxe closed this Nov 20, 2026
@RylanBot RylanBot reopened this Nov 20, 2026
Move the default expansion cases into the existing EnhancedTable test.
Keep string and number row keys separate from row selection.
@RylanBot RylanBot added to be published fixed, not be published easy labels Nov 20, 2026
@tdesign-bot

Copy link
Copy Markdown
Collaborator

TDesign Component Site Preview Open

Component Preview
tdesign-react 完成
@tdesign-react/chat 完成

@pkg-pr-new

pkg-pr-new Bot commented Nov 20, 2026

Copy link
Copy Markdown
  • tdesign-react-demo

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

commit: 7f07194

@uyarn
uyarn merged commit 682eb80 into Tencent:develop Nov 25, 2026
1 check passed
@tdesign-bot tdesign-bot mentioned this pull request Nov 26, 2026
6 of 16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

easy to be published fixed, not be published

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants