Repository navigation
[menu] Optimize submenu hover pointer-events - #4231
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
660916a to
212069a
Compare
| let rootId = parent.store.select('rootId'); | ||
| let floatingTreeRoot = parent.store.select('floatingTreeRoot'); | ||
| let keyboardEventRelay = parent.store.select('keyboardEventRelay'); |
There was a problem hiding this comment.
This change to MenuStore specifically mainly improves submenus that have nested triggers:
scoped + items (flatter case)
TaskDuration median: 1.602s -> 1.574s (-1.8%)
ScriptDuration median: 0.324s -> 0.308s (-4.7%)
scoped + triggers (nested submenu-trigger stress case)
TaskDuration median: 2.857s -> 2.030s (-28.9%)
ScriptDuration median: 1.483s -> 0.734s (-50.5%)
Codex ReviewOverviewThis PR changes hover submenus so pointer-event blocking stays local to the menu area instead of relying on a whole-page fallback, and it reduces unnecessary submenu updates from parent changes. The latest update removes the body/scoped toggle and keeps scoped behavior on all the time. FindingsNo blocking issues found in this patch. 1. ℹ️ [Informational] Focused Chromium timing is mostly close, with one noisy outlier on headImpact: The updated scoped-only path does not show a clear functional regression, but the timing samples are noisy and include one slower run on head. Evidence: Command used for both refs:
Recommendation: Keep an eye on this in CI perf runs; if the outlier pattern repeats, capture a larger sample size on the submenu-hover path before drawing conclusions. Confidence: 4/5High confidence from a full PR pass, focused jsdom/chromium tests on touched menu paths, and fresh head-vs-master timing checks. Notes
|
c5a7f46 to
00623e0
Compare
With big DOMs, this shows adding
pointer-events: none;on the<body>is much slower than scoping it to the menu itself when quickly sweeping over submenu triggers. The conditional scope check will be removed before merge.https://deploy-preview-4231--base-ui.netlify.app/experiments/menu/pointer-events-scope
Screen.Recording.2026-03-04.at.10.32.33.pm.mov