Repository navigation
[navigation menu] Fix initial trigger switch size snap - #4327
Conversation
Bundle size report
Check out the code infra dashboard for more information about this PR. |
0380425 to
0095a33
Compare
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex ReviewOverviewThis patch fixes the first trigger-switch size snap by moving pending popup size-reset ownership up to the navigation menu root, so a stale animation callback from the previous trigger cannot win. It also adds a stronger regression test that keeps overlapping animations visible and wraps the async completion path in FindingsNo blocking issues found in this patch. 1. 🟡 [Non-blocking] Regression coverage still misses the reported hover pathImpact: The new test protects the shared reset logic in general, but it does not exercise the exact interaction path from the original bug report. A future regression that only affects hover timing could slip through while this test still passes. Evidence: The user-facing report was about hovering between triggers, but the regression test opens and switches with Recommendation: Add a hover-driven version of this regression, or switch the current test to deterministic hover events, so the test covers the exact timing path that originally reproduced the snap. Confidence: 4/5High confidence based on a full-branch review across correctness, rendering/effect timing, accessibility/semantics, API/state design, maintainability/simplification, performance risk, and test quality. The latest CI on the current PR head also shows the relevant browser, lint, and regression jobs green; the main remaining risk is the hover-specific coverage gap above. Notes
|
2b75e51 to
f67e701
Compare
ed87b51 to
153f162
Compare
…menu-trigger-size-snap # Conflicts: # packages/react/src/navigation-menu/root/NavigationMenuRootContext.ts
…ze-snap' into codex/navigation-menu-trigger-size-snap
This is semi-hard to spot as it requires switching to a new trigger right as the popup's initial open animation is about to finish.
Summary
Prevents NavigationMenu from snapping to the next panel size when switching triggers right as the initial open animation finishes. The pending size reset from the first open is now canceled before a new trigger-switch resize transition starts.
Changes