Repository navigation
Conversation
A column with children only took part in sorting when it had a controlled `sortOrder`; its `defaultSortOrder` was ignored. Collect it the same way as for leaf columns. close ant-design#30791 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
👁 Visual Regression Report for PR #59611 Passed ✅
🎊 Congrats! No visual-regression diff found.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
More templates
commit: |
Bundle ReportChanges will increase total bundle size by 5.79MB (178.67%) ⬆️
Affected Assets, Files, and Routes:view changes for bundle: antd.min-array-pushAssets Changed:
|



中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
close #30791
💡 Background and Solution
A grouping column (one with
children) can have asorter, and a controlledsortOrderon it already works. ItsdefaultSortOrderwas ignored, though:collectSortStatesonly collected the controlledsortOrderfor grouping columns, while leaf columns also fall back todefaultSortOrderon init. So a grouping column withsorteranddefaultSortOrder: 'descend'rendered unsorted, with no active sort icon.This adds the same
defaultSortOrderbranch for grouping columns, with the sameinit && column.sorterguard as leaf columns.pushStatenow takes the sort order as an optional argument, so both default branches use it. There's no API change.The new test in
Table.sorter.test.tsxrenders a grouping column withsorteranddefaultSortOrder: 'descend'and checks the row order andaria-sort. It fails onmasterand passes with this change. All Table tests pass, and ESLint, Biome andtscare clean.I used Claude Code to write this change.
📝 Change Log
defaultSortOrdernot taking effect on grouping columns.defaultSortOrder不生效的问题。