-
Notifications
You must be signed in to change notification settings - Fork 358
fix(Select): optimize disabled condition check for multiple selection
#3879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes multiple bugs related to the Select component's behavior when using the multiple and checkAll options, specifically addressing issues with disabled options being incorrectly selectable or deselectable.
- Improves the check-all logic to properly handle disabled options by separating selectable and disabled items
- Fixes the filter option logic to use dynamic label keys instead of hardcoded 'label' property
- Updates the Option component to calculate selection states more accurately for check-all scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Select.tsx | Refactors check-all logic to properly handle disabled options and fixes filter option to use dynamic label key |
| PopupContent.tsx | Updates selectedValue filtering for checkAll options and passes additional props for accurate selection state |
| Option.tsx | Enhances selection state calculation by distinguishing between selectable and total selected lengths |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
disabled condition check for multiple selection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

🤔 这个 PR 的性质是?
🔗 相关 Issue
https://stackblitz.com/edit/kqqkg61k?file=src%2Fdemo.tsx
💡 需求背景和解决方案
(与 Tree 的 UI 交互保持一致)

📝 更新日志
fix(Select): 修复开启
multiple时,disabled的选项依旧能被删除的问题fix(Select): 修复
disabled且被选中的选项会被checkAll修改状态的问题fix(Select): 修复存在
disabled项时,checkAll可选框的checked与indeterminate状态不合理的问题本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单