fix: set aria-describedby when overlay is a false but valid node - #544
fix: set aria-describedby when overlay is a false but valid node#544zigzagdev wants to merge 1 commit into
aria-describedby when overlay is a false but valid node#544Conversation
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. WalkthroughChangesTooltip 可访问性属性
Estimated code review effort: 1 (简单) | ~5 分钟 Merge Risk: ⚪ Minimal · up to This change keeps the accessibility reference synchronized for valid falsy overlay content and is merge-ready after normal checks and review; no actionable merge-blocking risk remains. 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 1 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. |
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标识未能正确添加的问题。