Repository navigation
feat: unify allowClear configuration - #1257
Conversation
|
@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough本次更新使用共享的 ChangesallowClear 配置与清除按钮
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant useAllowClear
participant BaseSelect
participant SelectInput
participant ClearButton
useAllowClear->>BaseSelect: 返回 clearTabIndex
BaseSelect->>SelectInput: 传入 clearTabIndex
SelectInput->>ClearButton: 设置 tabIndex
Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1257 +/- ##
==========================================
- Coverage 99.46% 99.46% -0.01%
==========================================
Files 31 31
Lines 1307 1306 -1
Branches 477 457 -20
==========================================
- Hits 1300 1299 -1
Misses 7 7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
改动说明
接入
@rc-component/util@^1.14.0的useAllowClear和AllowClearConfig,统一 Select 的清除配置。支持disabled和清除按钮tabIndex,保留自定义图标、label、各模式的清除条件和回调行为;allowClear={{ disabled: true }}与allowClear={false}保持一致,并同步自定义 combobox 输入框的配置警告判断。补充配置文档和单选、多选、tags、combobox、按钮焦点及警告行为的回归测试。
相关讨论:ant-design/ant-design#59553
验证
Summary by CodeRabbit
allowClear新增配置项,可禁用清除按钮、设置其 Tab 导航顺序和无障碍标签,并自定义清除图标;禁用清除按钮时,输入仍可编辑,且不再为按钮预留空间。allowClear配置项及其行为说明。