Conversation
- Update @rc-component/util to 1.9.0 - Add ignoreElement to handle focus elements from Portal - Remove console.log in Panel component - Add test case for focus handling with Portal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. Walkthrough此 PR 为 Dialog Panel 的焦点锁定行为加入对 portal 中元素的处理:调整 useLockFocus 的使用以获取并调用 ignoreElement,将其绑定到 Panel 容器的 onFocus,新增示例文档与测试覆盖,以及升级了 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PortalInput as Portal Input (document.body)
participant Panel as Dialog Panel
participant useLock as useLockFocus (hook)
User->>PortalInput: click / focus
PortalInput->>Panel: focus event bubbles to container
Panel->>useLock: call ignoreElement(target)
useLock-->>Panel: mark element as ignored
Panel-->>PortalInput: allow keyboard input
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 of ChangesHello @zombieJ, 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 enhances the focus management within dialog components, specifically addressing scenarios where interactive elements are rendered using React Portals. By updating a core utility and integrating an Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #557 +/- ##
==========================================
+ Coverage 98.90% 98.92% +0.02%
==========================================
Files 8 8
Lines 182 186 +4
Branches 67 67
==========================================
+ Hits 180 184 +4
Misses 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request effectively resolves a focus-trapping issue when using elements within a Portal inside the Dialog. The approach of using the ignoreElement function from the updated @rc-component/util dependency is well-implemented through an onFocus event handler. The changes are supported by a new, relevant test case and a helpful demo page. The dependency update is also correctly handled. Overall, this is a solid fix.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
fix ant-design/ant-design#56782
Summary by CodeRabbit
发布说明
新功能
错误修复
测试
Chores