Skip to content

feat: ConfigProvider support customize trigger for Tooltip/Popover/Popconfirm#55932

Merged
zombieJ merged 8 commits intoant-design:featurefrom
aojunhao123:feat/20251126-a11y
Dec 1, 2025
Merged

feat: ConfigProvider support customize trigger for Tooltip/Popover/Popconfirm#55932
zombieJ merged 8 commits intoant-design:featurefrom
aojunhao123:feat/20251126-a11y

Conversation

@aojunhao123
Copy link
Contributor

🤔 This is a ...

  • 🆕 New feature
  • ⌨️ Accessibility improvement

🔗 Related Issues

💡 Background and Solution

  • The specific problem to be addressed.
  • List the final API implementation and usage if needed.
  • If there are UI/interaction changes, consider providing screenshots or GIFs.

📝 Change Log

Language Changelog
🇺🇸 English ConfigProvider supports configuring trigger for Tooltip, Popover, and Popconfirm.
🇨🇳 Chinese ConfigProvider 支持配置 Tooltip、Popover 和 Popconfirm 的 trigger 属性。

@bolt-new-by-stackblitz
Copy link

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

👁 Visual Regression Report for PR #55932 Passed ✅

🎯 Target branch: feature (964e21f)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎

🎊 Congrats! No visual-regression diff found.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Preview is ready

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

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.

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

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @aojunhao123, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new capability to the ConfigProvider that allows for centralized management of the trigger property for Tooltip, Popover, and Popconfirm components. This enhancement provides greater control over how these UI elements are activated, particularly addressing accessibility concerns by facilitating global configuration of keyboard focus triggers.

Highlights

  • Global Trigger Configuration: The ConfigProvider component now supports configuring the trigger property for Tooltip, Popover, and Popconfirm components globally, allowing for consistent activation behavior across an application.
  • Enhanced Accessibility: This feature significantly improves accessibility by enabling developers to easily set focus as a trigger mechanism for these components, making them more navigable via keyboard.
  • Documentation Updates: New documentation and FAQ entries have been added in both English and Chinese, explaining how to utilize the new trigger configuration for improved keyboard accessibility, with practical code examples.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 26, 2025

@codecov
Copy link

codecov bot commented Nov 26, 2025

Bundle Report

Changes will increase total bundle size by 2.83kB (0.07%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.89MB 2.83kB (0.07%) ⬆️

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 1.42kB 2.14MB 0.07%
antd.min.js 1.42kB 1.75MB 0.08%

Files in antd-with-locales.min.js:

  • ./components/config-provider/context.ts → Total Size: 1.93kB

Files in antd.min.js:

  • ./components/config-provider/context.ts → Total Size: 1.93kB

@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6a1c837) to head (bd4feef).
⚠️ Report is 25 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #55932   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          803       804    +1     
  Lines        14893     14816   -77     
  Branches      3954      3914   -40     
=========================================
- Hits         14893     14816   -77     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature by allowing Tooltip, Popover, and Popconfirm to have their trigger property configured globally via ConfigProvider. This is particularly useful for accessibility, as it enables setting focus triggers across the application. The implementation is solid, correctly propagating the context value and prioritizing component props. The documentation has been updated accordingly, including a helpful new FAQ section. I've found a couple of minor documentation inconsistencies that I've commented on. Overall, great work!

Comment on lines +173 to +175
| tooltip | Set Tooltip common props | { className?: string, style?: React.CSSProperties, classNames?:[Tooltip\["classNames"\]](/components/tooltip#semantic-dom), styles?: [Tooltip\["styles"\]](/components/tooltip#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, unique?: boolean, trigger?: [Tooltip\["trigger"\]](/components/tooltip#api) } | - | |
| popover | Set Popover common props | { className?: string, style?: React.CSSProperties, classNames?:[Popover\["classNames"\]](/components/popover#semantic-dom), styles?: [Popover\["styles"\]](/components/popover#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popover\["trigger"\]](/components/popover#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
| popconfirm | Set Popconfirm common props | { className?: string, style?: React.CSSProperties, classNames?:[Popconfirm\["classNames"\]](/components/popconfirm#semantic-dom), styles?: [Popconfirm\["styles"\]](/components/popconfirm#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popconfirm\["trigger"\]](/components/popconfirm#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are a couple of issues in this table:

  • The version for the new trigger prop on tooltip is missing. It should be added for consistency.
  • The markdown links for popover and popconfirm have a syntax error (an extra } at the end of the link) which breaks them.
Suggested change
| tooltip | Set Tooltip common props | { className?: string, style?: React.CSSProperties, classNames?:[Tooltip\["classNames"\]](/components/tooltip#semantic-dom), styles?: [Tooltip\["styles"\]](/components/tooltip#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, unique?: boolean, trigger?: [Tooltip\["trigger"\]](/components/tooltip#api) } | - | |
| popover | Set Popover common props | { className?: string, style?: React.CSSProperties, classNames?:[Popover\["classNames"\]](/components/popover#semantic-dom), styles?: [Popover\["styles"\]](/components/popover#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popover\["trigger"\]](/components/popover#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
| popconfirm | Set Popconfirm common props | { className?: string, style?: React.CSSProperties, classNames?:[Popconfirm\["classNames"\]](/components/popconfirm#semantic-dom), styles?: [Popconfirm\["styles"\]](/components/popconfirm#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popconfirm\["trigger"\]](/components/popconfirm#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
| tooltip | Set Tooltip common props | { className?: string, style?: React.CSSProperties, classNames?:[Tooltip["classNames"]](/components/tooltip#semantic-dom), styles?: [Tooltip["styles"]](/components/tooltip#semantic-dom), arrow: boolean | { pointAtCenter: boolean }, unique?: boolean, trigger?: [Tooltip["trigger"]](/components/tooltip#api) } | - | trigger: 6.1.0 |
| popover | Set Popover common props | { className?: string, style?: React.CSSProperties, classNames?:[Popover["classNames"]](/components/popover#semantic-dom), styles?: [Popover["styles"]](/components/popover#semantic-dom), arrow: boolean | { pointAtCenter: boolean }, trigger?: [Popover["trigger"]](/components/popover#api) } | - | 5.23.0, arrow: 6.0.0, trigger: 6.1.0 |
| popconfirm | Set Popconfirm common props | { className?: string, style?: React.CSSProperties, classNames?:[Popconfirm["classNames"]](/components/popconfirm#semantic-dom), styles?: [Popconfirm["styles"]](/components/popconfirm#semantic-dom), arrow: boolean | { pointAtCenter: boolean }, trigger?: [Popconfirm["trigger"]](/components/popconfirm#api) } | - | 5.23.0, arrow: 6.0.0, trigger: 6.1.0 |

Comment on lines +175 to +177
| tooltip | 设置 Tooltip 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Tooltip\["classNames"\]](/components/tooltip-cn#semantic-dom), styles?: [Tooltip\["styles"\]](/components/tooltip-cn#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, unique?: boolean, trigger?: [Tooltip\["trigger"\]](/components/tooltip-cn#api)} | - | `trigger`: 6.1.0 |
| popover | 设置 Popover 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Popover\["classNames"\]](/components/popover-cn#semantic-dom), styles?: [Popover\["styles"\]](/components/popover-cn#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popover\["trigger"\]](/components/popover-cn#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
| popconfirm | 设置 Popconfirm 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Popconfirm\["classNames"\]](/components/popconfirm-cn#semantic-dom), styles?: [Popconfirm\["styles"\]](/components/popconfirm-cn#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popconfirm\["trigger"\]](/components/popconfirm-cn#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a syntax error in the markdown table. The links for tooltip, popover, and popconfirm have an extra closing curly brace } which breaks the link. Please remove it.

Suggested change
| tooltip | 设置 Tooltip 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Tooltip\["classNames"\]](/components/tooltip-cn#semantic-dom), styles?: [Tooltip\["styles"\]](/components/tooltip-cn#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, unique?: boolean, trigger?: [Tooltip\["trigger"\]](/components/tooltip-cn#api)} | - | `trigger`: 6.1.0 |
| popover | 设置 Popover 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Popover\["classNames"\]](/components/popover-cn#semantic-dom), styles?: [Popover\["styles"\]](/components/popover-cn#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popover\["trigger"\]](/components/popover-cn#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
| popconfirm | 设置 Popconfirm 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Popconfirm\["classNames"\]](/components/popconfirm-cn#semantic-dom), styles?: [Popconfirm\["styles"\]](/components/popconfirm-cn#semantic-dom), arrow: boolean \| { pointAtCenter: boolean }, trigger?: [Popconfirm\["trigger"\]](/components/popconfirm-cn#api)} | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
| tooltip | 设置 Tooltip 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Tooltip["classNames"]](/components/tooltip-cn#semantic-dom), styles?: [Tooltip["styles"]](/components/tooltip-cn#semantic-dom), arrow: boolean | { pointAtCenter: boolean }, unique?: boolean, trigger?: [Tooltip["trigger"]](/components/tooltip-cn#api) } | - | `trigger`: 6.1.0 |
| popover | 设置 Popover 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Popover["classNames"]](/components/popover-cn#semantic-dom), styles?: [Popover["styles"]](/components/popover-cn#semantic-dom), arrow: boolean | { pointAtCenter: boolean }, trigger?: [Popover["trigger"]](/components/popover-cn#api) } | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |
| popconfirm | 设置 Popconfirm 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?:[Popconfirm["classNames"]](/components/popconfirm-cn#semantic-dom), styles?: [Popconfirm["styles"]](/components/popconfirm-cn#semantic-dom), arrow: boolean | { pointAtCenter: boolean }, trigger?: [Popconfirm["trigger"]](/components/popconfirm-cn#api) } | - | 5.23.0, `arrow`: 6.0.0, `trigger`: 6.1.0 |

Signed-off-by: aojunhao123 <1844749591@qq.com>
@socket-security
Copy link

socket-security bot commented Nov 29, 2025

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​rc-component/​tooltip@​1.3.4 ⏵ 1.4.09010010094 -1100

View full report

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 1, 2025
@zombieJ zombieJ merged commit ca5817a into ant-design:feature Dec 1, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants