Repository navigation
fix(menu): Keep submenus beside scrolled parent menus - #4186
minwookshin wants to merge 3 commits into
Conversation
Use horizontal flipping for default submenu positioning while retaining explicit fallback placements and custom Popper options. Cover scrolled parents, viewport edges, RTL and overrides in component tests. Fixes Workday#4180
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Workday/canvas-kit/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthrough
ChangesSubmenu placement
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change keeps default submenus beside their parent menu when it scrolls, while explicit placements and custom Popper options still apply. No merge-blocking risk was found. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The reviewed change adjusts submenu positioning without introducing a new security boundary or granting callers additional authority. Explicit positioning overrides were already supported. No introduced or materially worsened security risk was identified. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Workday/canvas-kit
|
|||||||||||||||||||||||||||||||||||||||||||||||||
| Project |
Workday/canvas-kit
|
| Branch Review |
fix/submenu-scroll-placement
|
| Run status |
|
| Run duration | 02m 30s |
| Commit |
|
| Committer | Minwook Shin |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
2
|
|
|
0
|
|
|
4
|
|
|
0
|
|
|
362
|
| View all changes introduced in this branch ↗︎ | |
Warning
Partial Report: The results for the Application Quality reports may be incomplete.
UI Coverage
14.01%
|
|
|---|---|
|
|
1547
|
|
|
252
|
Accessibility
98.06%
|
|
|---|---|
|
|
3 critical
3 serious
0 moderate
2 minor
|
|
|
7
|
Tests for review

SubmenuPlacement.spec.tsx • 2 failed tests
| Test | Artifacts | |
|---|---|---|
| ... > should remain beside the parent without covering it |
Test Replay
Screenshots
|
|
| ... > should remain beside the parent without covering it |
Test Replay
Screenshots
|
|
The first 5 failed specs are shown, see all 29 specs in Cypress Cloud.
|
Accounted for parent scrollbar gutters in submenu placement and made the regression reserve scrollbar space on every platform. The placement and existing menu browser tests, all 4,138 unit tests, typechecks, and lint pass locally. |
Summary
Fixes: #4180
When scrolling moves a submenu trigger out of view, the generic fallback modifier can place the submenu over its parent. Default submenus now flip horizontally to the opposite side and retain their start alignment. Explicit fallback placements and custom Popper options preserve their existing override behavior.
Release Category
Components
Release Note
Submenus stay beside their parent menu while scrolling, including at viewport edges. Custom placement and fallback options remain available.
Checklist
ready for reviewhas been added to PR (requires maintainer access).Where Should the Reviewer Start?
modules/react/menu/lib/Submenu.tsx, followed bycypress/component/SubmenuPlacement.spec.tsx.Areas for Feedback?
Default submenu positioning when its trigger is vertically clipped, and preservation of explicit placement overrides.
Validation
Testing Manually
Open the
ScrollableSubmenuMenu story, open More Items, then scroll the parent list until the trigger moves out of view. The submenu should remain beside the parent. The component suite also covers RTL, both viewport edges, custom offsets, explicit placement, and an empty fallback list.Summary by CodeRabbit