Skip to content

fix(react-menu-grid-preview): submenus stay open when moving mouse from trigger to popover#35862

Merged
bsunderhus merged 3 commits intomicrosoft:masterfrom
bsunderhus:fix/menu-grid-submenu-hover
Mar 11, 2026
Merged

fix(react-menu-grid-preview): submenus stay open when moving mouse from trigger to popover#35862
bsunderhus merged 3 commits intomicrosoft:masterfrom
bsunderhus:fix/menu-grid-submenu-hover

Conversation

@bsunderhus
Copy link
Copy Markdown
Contributor

@bsunderhus bsunderhus commented Mar 11, 2026

Summary

  • Root cause: MenuGrid did not provide MenuListContext, so nested Menu components returned isSubmenu = false from useIsSubmenu(). This meant openOnHover = false, which caused MenuPopover.onMouseEnter to never call setOpen(true) to clear the pending 500ms close timeout triggered by MENU_ENTER_EVENT as the mouse crossed the outer MenuPopover.
  • Fix: MenuGrid now provides MenuListContext via MenuListProvider, making it a proper semantic alternative to MenuList. Nested Menu components now detect isSubmenu = trueopenOnHover = true → hover-to-keep-open works correctly.
  • Tests: Added 2 regression e2e tests (verified they fail without the fix and pass with it) and introduced the missing menuItemSelector constant in the test file.

Test plan

  • Run yarn nx run react-menu-grid-preview:e2e — all 8 tests pass
  • Verified new tests fail without the fix (stashed implementation, ran tests → 6 pass, 2 fail)
  • Verified new tests pass with the fix restored → 8 pass
  • Manual: open MenuGridWithSubmenu story, hover a "More actions" button, then slowly move the mouse into the submenu popover — submenu should remain open

🤖 Generated with Claude Code

…om trigger to popover

MenuGrid now provides MenuListContext, making nested Menu components
detect themselves as submenus (openOnHover=true). This ensures
MenuPopover.onMouseEnter clears any pending close timeout when the
user moves the mouse from a submenu trigger into the submenu popover.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bsunderhus bsunderhus requested a review from a team as a code owner March 11, 2026 10:31
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 11, 2026

📊 Bundle size report

✅ No changes found

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

…ing safeZone pattern

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bsunderhus bsunderhus enabled auto-merge (squash) March 11, 2026 12:12
@bsunderhus bsunderhus merged commit de66193 into microsoft:master Mar 11, 2026
12 checks passed
@bsunderhus bsunderhus deleted the fix/menu-grid-submenu-hover branch March 11, 2026 12:25
tudorpopams pushed a commit to tudorpopams/fluentui that referenced this pull request Apr 14, 2026
…om trigger to popover (microsoft#35862)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants