Repository navigation
[navigation-menu] Fix frozen menu when the open trigger unmounts - #5240
Conversation
commit: |
Bundle size
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. |
PR reviewNo correctness blockers. The component-scoped unmount cleanup addresses the stale list lock and is ownership-safe; the only suggestion is an optional consolidation with the existing hover-state effect. The PR’s Chromium regression passed, and the consolidated form also passed the full Navigation Menu suites in Chromium and jsdom. Bugs (0)No findings. Tests (0)No findings. Simplifications (1)1. ℹ️ Fold the unmount cleanup into the existing hover-state effectLocation: React.useEffect(() => {
return () => {
clearSafePolygonPointerEventsMutation(hoverInteractionState);
};
}, [hoverInteractionState]);The standalone effect is correct, but the effect immediately above already owns the closed-state reset for the same The consolidated form passed all Navigation Menu tests: 286 passed and 17 skipped in Chromium; 278 passed and 25 skipped in jsdom. Failure scenario: There is no user-visible failure in the current patch; the separate effect adds unnecessary hook work and production code for lifecycle handling that can share one effect. Fix: Return Do not move this into Docs (0)No findings. VerdictApprove - the lifecycle fix is correct; consolidating the effect is optional. 🤖 Review generated with Codex |
|
Applied the simplification |
Fixes #5239
The contributing guide does not have a PR section 🤔