Skip to content

feat: unify allowClear configuration - #668

Merged
zombieJ merged 1 commit into
react-component:masterfrom
QDyanbing:feat-unify-allow-clear
Oct 13, 2026
Merged

zombieJ merged 1 commit into
react-component:masterfrom
QDyanbing:feat-unify-allow-clear

Conversation

@QDyanbing

@QDyanbing QDyanbing commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

改动说明

将 @rc-component/select 的最低依赖版本升级为 ~1.12.0,将 util 升级为 ^1.14.0,让 Cascader 继承统一的 AllowClearConfig 类型和清除行为。

allowClear={{ disabled: true }} 与 allowClear={false} 保持一致;自定义图标、label 和清除按钮 tabIndex 完整传递给 Select,保留单选、勾选多选的清空值及回调行为。

补充配置文档和回归测试,覆盖动态禁用、配置恢复、按钮标签与 tabIndex,以及清除回调次数和清空值。

相关讨论:ant-design/ant-design#59553

验证

  • 使用 npm 正式发布的 Select 1.12.0、util 1.14.0 验证。
  • 全量测试及覆盖率采集通过:128 项测试通过、2 项跳过,3 个快照通过。
  • TypeScript 检查、lint、库编译通过(lint 有既有警告)。
  • Chromium 验证实际布局、动态切换、焦点与选区、Tab/Shift+Tab、鼠标点击及 Enter/Space 清除,运行时无报错。

Summary by CodeRabbit

  • 功能改进
    • 清除按钮支持禁用、自定义图标和设置键盘导航顺序;禁用后仍可编辑输入框,并保留现有后缀及其他内容。
    • 支持为清除按钮设置可访问名称;将其移出 Tab 导航后,仍可通过鼠标操作。
  • 文档
    • 补充清除配置选项、默认行为及相关限制的说明。

@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

@QDyanbing is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8f1dda78-4612-438c-a598-ef0cf56725e1
📥 Commits

Reviewing files that changed from the base of the PR and between 4e272d6 and 3217726.

📒 Files selected for processing (3)
  • README.md
  • package.json
  • tests/allowClear.spec.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

本次更新调整 @rc-component/select 和 @rc-component/util 的依赖版本,补充 allowClear 配置文档,并新增相关测试。

Changes

allowClear 配置

Layer / File(s) Summary
配置说明与测试
package.json, README.md, tests/allowClear.spec.tsx
更新 @rc-component/select 和 @rc-component/util 的版本约束。文档说明 allowClear 配置字段及行为。测试覆盖禁用配置、图标和 tabIndex,以及点击后的回调、变更值和按钮移除。

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: zombiej

Merge Risk: ⚪ Minimal · up to 32177

This change updates two dependency versions, documents the allowClear configuration, and adds tests. No merge-blocking risk was found.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题“feat: unify allowClear configuration”准确概括了本次变更的主要内容,包括统一 allowClear 配置及相关行为。标题简洁且与文档、依赖更新和回归测试一致。
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

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.

❤️ Share

小兔捧来配置文档,
清除按钮有了新说明。
点一点,值已归清,
回调轻快地响一声。
月光下,测试安然收工。

Comment @coderabbitai help to get the list of available commands.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​rc-component/​select@​1.11.0 ⏵ 1.12.09810010093 -5100

View full report

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.40%. Comparing base (4e272d6) to head (3217726).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #668   +/-   ##
=======================================
  Coverage   99.40%   99.40%           
=======================================
  Files          22       22           
  Lines         669      669           
  Branches      201      201           
=======================================
  Hits          665      665           
  Misses          4        4           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zombieJ
zombieJ merged commit 74ca2af into react-component:master Oct 13, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants