feat(TreeSelect): support ConfigProvider allowClear by QDyanbing · Pull Request #59592 · ant-design/ant-design · GitHub
Skip to content

feat(TreeSelect): support ConfigProvider allowClear - #59592

Open
QDyanbing wants to merge 1 commit into
featurefrom
feat-tree-select-global-allow-clear
Open

QDyanbing wants to merge 1 commit into
featurefrom
feat-tree-select-global-allow-clear

Conversation

@QDyanbing

Copy link
Copy Markdown
Member

English Template / 英文模板

🤔 这个变动的性质是?

  • 🆕 新特性提交
  • 🐞 Bug 修复
  • 📝 站点、文档改进
  • 📽️ 演示代码改进
  • 💄 组件样式/交互改进
  • 🤖 TypeScript 定义更新
  • 📦 包体积优化
  • ⚡️ 性能优化
  • ⭐️ 功能增强
  • 🌐 国际化改进
  • 🛠 重构
  • 🎨 代码风格优化
  • ✅ 测试用例
  • 🔀 分支合并
  • ⏩ 工作流程
  • ⌨️ 无障碍改进
  • ❓ 其他改动(是关于什么的改动?)

🔗 相关 Issue

关联 #59540(本 PR 仅补充 TreeSelect 的全局清除配置)。

RFC: #59553

💡 需求背景和解决方案

TreeSelect 的清除按钮此前只能通过组件属性配置,无法在 ConfigProvider 中统一设置。本 PR 为现有 treeSelect 配置补充 allowClear,支持 clearIcon、disabled、tabIndex 和 label。

<ConfigProvider treeSelect={{ allowClear: { tabIndex: -1 } }}>
  <TreeSelect treeData={treeData} />
</ConfigProvider>

按组件属性、全局配置、默认值的顺序逐字段取值。组件的 allowClear={false} 关闭清除按钮;allowClear={true} 继承全局对象,disabled: false 和 tabIndex: 0 可显式覆盖全局字段。同步补充中英文 API 文档。

验证:相关 3 个 Jest 测试套件、49 项测试和 2 个快照通过;全量 TypeScript、ESLint、Biome、文档及格式检查通过。覆盖全局字段继承、局部覆盖、嵌套 ConfigProvider 继承及动态更新;CR 未发现需修复问题。

📝 更新日志

语言 更新描述
🇺🇸 英文 🆕 Add ConfigProvider allowClear configuration for TreeSelect.
🇨🇳 中文 🆕 新增 TreeSelect 的 allowClear 全局配置,支持通过 ConfigProvider 统一设置。

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

👁 Visual Regression Report for PR #59592 Passed ✅

🎯 Target branch: feature (ffd1a0c)
⚠️ Baseline may be stale: no snapshot for the PR's base commit was found, so an older branch snapshot was used. Some diffs below may come from changes already merged into feature rather than this PR.
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

📖 中文报告

👁 PR #59592 视觉回归报告 通过 ✅

🎯 目标分支: feature (ffd1a0c)
⚠️ 基线可能已过期: 未找到该 PR 基准提交对应的快照,因此回退使用了较旧的分支快照。下方部分差异可能来自已合并到 feature 的改动,而非本 PR。

🎊 恭喜!未发现视觉回归差异。

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Preview is ready

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8067b43d-971c-46dd-826b-6c23c10ca3f5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
dist/antd.min.js 447.21 KB (+14 B 🔺)
dist/antd-with-locales.min.js 539.08 KB (+22 B 🔺)

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 146 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.28MB 146 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.min.js 73 bytes 1.84MB 0.0%
antd.min.js 73 bytes 1.44MB 0.01%

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: e9eea74
Status: ✅  Deploy successful!
Preview URL: https://14848730.ant-design.pages.dev
Branch Preview URL: https://feat-tree-select-global-allo.ant-design.pages.dev

View logs

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

1 participant