fix: make hidden overflow items inert - #70
Conversation
|
@nrps9909 is attempting to deploy a commit to the React Component 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: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Walkthrough隐藏的响应式溢出项现在设置 Changes隐藏项可访问性
Estimated code review effort: 2 (简单) | ~10 分钟 Merge Risk: ⚪ Minimal · up to This localized change makes visually hidden responsive items inert while preserving visible-item and overflow-menu behavior; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Summary
inertwhile they are visually hiddenaria-hiddenfor the accessibility-tree contractThe existing styles and
aria-hiddenremove hidden items visually and from the accessibility tree, butaria-hiddendoes not remove focusable descendants from sequential keyboard navigation.inertcloses that gap without changing visible-item or overflow-menu behavior.The value is serialized conditionally because this package supports React 16.9+: React 16–18 require the unknown attribute to be passed as a string, while React 19 treats
inertas a boolean property.Closes #43.
Verification
inertattributenpm run tscnpm run lint— 0 errors, 4 pre-existing Hook dependency warningsnpm run compile— ESM, CJS, and declarations passedgit diff --check<div inert="">…</div>with no warninginert; boolean form warns and is omittedinert=""and the repository suite passes without warningsNo current open PR addresses hidden-item focusability or adds
inert.AI assistance disclosure: Codex was used to trace the hidden-item DOM contract, audit open-PR overlap, add the regression, and verify React-version serialization. The exact-base failure, compatibility probes, and final diff were reviewed locally.
Summary by CodeRabbit
aria-hidden和inert,避免被辅助技术或键盘导航访问。