GeezerVison is showing github.com — fix: preserve child aria-describedby by nrps9909 · Pull Request #542 · react-component/tooltip
Conversation
nrps9909
commented
Aug 27, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Preserve an existing child aria-describedby when the tooltip is hidden, and compose it with the generated tooltip id while the tooltip is open.
Problem
The current child clone always supplies aria-describedby. When the tooltip is closed it supplies undefined, which removes a description already owned by the child. When the tooltip opens, the generated tooltip id replaces that existing description instead of joining the ARIA ID-reference list.
I found this while validating ant-design/ant-design#59110: a Slider handle passed ariaDescribedByForHandle receives the attribute from rc-slider, but the default Ant Design SliderTooltip wrapper removes it.
Validation
The regression covers the full controlled visibility cycle:
- hidden: preserves the child description id
- visible: exposes both the child description and tooltip ids
- hidden again: restores the child description id
Exact-base behavior fails the first assertion. On this head:
npm test -- --runInBand tests/index.test.tsx: 30 tests passed
npm run coverage -- --runInBand: 100% statements, branches, functions, and lines
npm run tsc
npm run lint
npx prettier --check src/Tooltip.tsx tests/index.test.tsx
npm run compile (ESM, CJS, declarations, and Less assets)
git diff --check
AI assistance disclosure: Codex was used to trace the Ant Design integration failure, construct the exact-base regression, and run the validation matrix. The behavior and results above were verified locally.
Summary by CodeRabbit
- Bug Fixes
- 优化 Tooltip 的无障碍描述属性处理。
- 当 Tooltip 显示时,保留并合并子元素已有的描述信息;隐藏时恢复原有属性。
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Aug 27, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f2f2ec87-7c89-4201-96da-9bbc9ef85662
📥 Commits
Reviewing files that changed from the base of the PR and between 4cc3d61 and 2f82eb0.
📒 Files selected for processing (2)
src/Tooltip.tsx
tests/index.test.tsx
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Walkthrough
Tooltip 现在保留子元素已有的 aria-describedby。Tooltip 显示时,代码会合并已有描述 ID 与 mergedId。新增测试覆盖可见性切换。
Changes
Tooltip 描述属性
| Layer / File(s) |
Summary |
合并并验证描述属性 src/Tooltip.tsx, tests/index.test.tsx |
getChildren 在 Tooltip 显示时合并已有的 aria-describedby 与 mergedId。测试验证隐藏、显示和再次隐藏时的属性值。 |
Estimated code review effort: 2 (简单) | ~10 minutes
Merge Risk: ⚪ Minimal · up to 2f82e
This localized change preserves existing child descriptions while composing them with the tooltip description when visible; no actionable merge-blocking risk remains after normal checks and review.
Suggested reviewers: zombiej
Poem
小兔检查描述串,
旧 ID 安静留身旁。
Tooltip 显示添新名,
隐藏之后归原状。
测试跳过三步舞,
属性清晰又稳当。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
✅ Passed |
标题“fix: preserve child aria-describedby”准确概括了主要变更:保留并合并子元素已有的 aria-describedby。标题简洁、明确,并与代码和回归测试一致。 |
| 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 2… |
| 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. |
Full details: Docstring Coverage
Explanation
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 2 files.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4cc3d61) to head (2f82eb0).
Additional details and impacted files
@@ Coverage Diff @@
## master #542 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 36 38 +2
Branches 14 15 +1
=========================================
+ Hits 36 38 +2
☔ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
yoyo837
yoyo837 approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|