Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughEscape 事件来自非根级嵌套菜单时,外层弹出层不会关闭,焦点保持不变。根菜单收到 Escape 时,仍会关闭弹出层并将焦点返回触发器。新增测试覆盖这两种情况。 Changes菜单 Escape 处理
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related issues
Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #275 +/- ##
==========================================
+ Coverage 99.17% 99.23% +0.06%
==========================================
Files 5 5
Lines 121 131 +10
Branches 36 44 +8
==========================================
+ Hits 120 130 +10
Misses 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Problem and behavior
A window Escape listener should leave Escape inside a nested menu to that menu instead of closing its surrounding Dropdown first. Identify the root overlay menu (Menu's
listref, a DOM ref, or a wrapped menu), and skip outer close/focus when the event comes from a different, portaled menu. Root-menu Escape and non-menu overlays keep their existing behavior.Refs #274 and react-component/menu#899. The Menu companion consumes Escape after closing a submenu; both changes preserve nested-menu behavior when #273 moves this listener to capture. This PR is based on current master and deliberately does not include #273's listener-phase changes. It can be reviewed independently; this guard alone is not a complete fix with menu 1.6.0, whose Escape still bubbles to the portal listener.
Validation
npm test -- --runInBand --no-cache: 6 suites, 33 tests, 1 snapshot passed.Same resolved dependency tree used for controls (React/ReactDOM19.3.1, trigger3.10.1, portal2.2.1); source Menu uses one aliased React instance. No npm-release inclusion, remote-CI result, or screen-reader conformance claimed by these local checks.
AI assistance disclosure: Codex assisted implementation, regression tests and native-browser verification; results were executed locally. No duplicate implementation of #273 is included.
Summary by CodeRabbit