fix(TreeSelect): preserve disabled child selection - #681
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough本次变更调整 ChangesSHOW_PARENT 保留逻辑
Estimated code review effort: 2 (简单) | ~10 分钟 Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #681 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 17 17
Lines 629 633 +4
Branches 178 181 +3
=======================================
+ Hits 628 632 +4
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |

Summary
SHOW_PARENTRoot cause
SHOW_PARENTfiltered every child whose parent was selected without considering whether the child itself was disabled. In a controlled TreeSelect, the emitted value therefore dropped the disabled child and cleared its selection on the next render.Validation
ut test --runInBand(184 tests passed)ut tscut lint(0 errors; 6 existing warnings)Related to ant-design/ant-design#16096
Summary by CodeRabbit
Bug 修复
SHOW_PARENT选择策略:勾选父节点时,已选中的禁用子节点会继续保留。TreeSelect中将同时正确显示父节点及其禁用子节点,避免已选内容意外丢失。测试