fix: set aria-describedby when overlay is a false but valid node - #544
Conversation
overlay values like 0 are valid renderable content, but the previous `overlay && open` check treated them as absent and skipped aria-describedby even while the tooltip was visible.
|
@zigzagdev is attempting to deploy a commit to the afc163's projects 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⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughTooltip 现在在 ChangesTooltip 可访问性属性
Estimated code review effort: 1 (简单) | ~5 分钟 Merge Risk: ⚪ Minimal · up to Tooltips now provide an accessibility description for visible falsy values such as 0 while continuing to omit it for null and undefined overlays. The expected behavior is covered by tests, with no current merge-readiness risk identified. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation 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 💡
🧪 Generate unit tests (beta)
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. Comment |
|
Need some test case to cover this. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #544 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 38 38
Branches 15 15
=========================================
Hits 38 38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Motivation
getChildrendecided whether to attacharia-describedbyusingoverlay && open, so a falsy-but-valid overlay (e.g.overlay={0}) was rendered visibly byPopupbut never got anaria-describedbyreference, leaving the accessible relationship out of sync with what's on screen.What I have done
overlay != null && openso only "no overlay provided" (null/undefined) skips the attribute, while any other renderable value (including0or'') still gets described correctly when it open.Test plan
rc-test tests/index.test.tsx— all 29 existing tests pass (run in a Dockernode:20container since localnode_moduleswasn't installed)Summary by CodeRabbit
aria-describedby标识未能正确添加的问题。null或undefined,即使为空字符串或其他假值,也能正确关联辅助功能描述。