Repository navigation
Conversation
lnuxe
requested review from
HaixingOoO,
NWYLZW,
RylanBot,
ZWkang,
carolin913,
honkinglin and
uyarn
as code owners
November 12, 2026 10:11
lnuxe
force-pushed
the
fix/select-check-all-direction
branch
from
November 13, 2026 03:09
1c731e4 to
f4260d8
Compare
Collaborator
TDesign Component Site Preview Open
|
commit: |
lnuxe
force-pushed
the
fix/select-check-all-direction
branch
from
November 17, 2026 02:06
5bf7cb8 to
fc97866
Compare
The check-all option decided its direction from the internal selected state:
if (checkAll) { ... trigger: isAllSelected ? 'uncheck' : 'check' }
When the caller resets the value from outside, the internal state and the
rendered options disagree for one render, so clicking check-all could fire
the opposite action - unchecking when everything was already cleared.
Compute the direction from the options that are actually rendered and
enabled.
Verified:
- new test fails on the previous implementation
(expected [] to deeply equal [ 'apple', 'orange', 'banana' ])
- new test passes with the fix
- select: 47 tests pass
The check-all test has to reach the option list through document because the popup is teleported to body, so render()'s container does not contain it. Nothing removed those nodes afterwards, which leaves them in body for every later case in the same file - the exact shape of the E-001 mistake. Add an afterEach that runs cleanup() and clears body. Verified: - select: 3 files / 47 tests passed - preflight.sh: 0 failures
Contributor
Author
|
已 rebase 到 develop 两处改动互补,不重复:
冲突解决后完整保留 #4419 的分支( 验证:
|
lnuxe
force-pushed
the
fix/select-check-all-direction
branch
from
November 26, 2026 19:19
fc97866 to
2497b4b
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 直接修复 Select 全选方向与受控 value 不同步)
💡 需求背景和解决方案
onCheckAllChange用checkAll决定是「全选」还是「取消全选」,而checkAll来自 Option 组件内部的allSelectableCheckedstate:这个内部 state 只在点击时翻转,从不与
valueprop 同步。所以一旦父组件重置或裁剪了选中值,两边就对不上:再点「全选」会走取消分支,回传空数组。改动
以当前
value为准计算方向——只要还有未选中的可用选项,就是「全选」:🔍 自测
修复前(还原
Select.tsx后跑新测试):修复后:
用例覆盖完整交互链:全选 → 取消一项 → 再点全选,第三次点击必须重新全选而不是清空。
回归:
✅ 贡献者检查
📝 更新日志
tdesign-react
☑️ 请求合并前的自查清单