-
Notifications
You must be signed in to change notification settings - Fork 538
fix(Select): Even if set disabled
options Tag
still can be deleted
#5488
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
TDesign Component Site Preview Open
|
commit: |
/update-snapshot |
⏳ 正在运行快照更新。。。 CI: Open |
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 an issue where in multiple mode a disabled option's tag could still be removed via the backspace key or tag deletion.
- Introduces a new logic branch to skip disabled options when removing by backspace.
- Refactors the value display rendering in multiple selection mode using a new renderValueDisplay function.
- Updates example and snapshot files for consistency.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/components/select/select.tsx | Adds backspace handling for disabled options and refactors valueDisplay logic. |
packages/components/select/_example/multiple.vue | Updates default selected values for the multiple selection demo. |
packages/components/select/tests/snapshots/index.test.jsx.snap | Minor snapshot formatting adjustments. |
Comments suppressed due to low confidence (1)
packages/components/select/select.tsx:205
- [nitpick] The variable name 'values' is used to represent a single option. Consider renaming it to 'targetOption' or 'removedOption' for clarity.
const values = currentSelected[closest];
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
tdesign-vue-next
@tdesign-vue-next/chat
☑️ 请求合并前的自查清单