Repository navigation
fix(TopNavMegaMenu): positioning, keyboard, alignment, and responsive layout - #622
Merged
Merged
Conversation
cixzhang
force-pushed
the
navi/fix/mega-menu-positioning
branch
from
March 15, 2026 06:06
7b61b8d to
44690bb
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsHoverCard · View in Storybook
TopNav · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
force-pushed
the
navi/fix/mega-menu-positioning
branch
from
March 15, 2026 21:05
44690bb to
715f663
Compare
cixzhang
commented
Mar 15, 2026
cixzhang
commented
Mar 15, 2026
cixzhang
commented
Mar 15, 2026
cixzhang
commented
Mar 15, 2026
cixzhang
commented
Mar 15, 2026
cixzhang
commented
Mar 15, 2026
cixzhang
commented
Mar 15, 2026
cixzhang
force-pushed
the
navi/fix/mega-menu-positioning
branch
from
March 15, 2026 21:23
715f663 to
231a3c1
Compare
cixzhang
commented
Mar 15, 2026
cixzhang
force-pushed
the
navi/fix/mega-menu-positioning
branch
from
March 15, 2026 21:25
231a3c1 to
e022230
Compare
… focus trapping Mega menu + menu overhaul addressing #565 findings: Positioning: - MegaMenu: anchor to parent <nav> via useXDSPopover - Menu: anchor to trigger button via useXDSPopover - Both: slot-aware alignment via TopNavSlotContext - Removed anchorStretch override and position:relative wrapper requirement Focus & Keyboard: - Both use useXDSPopover for focus trapping (tab cycles within menu) - Menu uses useListFocus for arrow key navigation between items - MegaMenu uses tab navigation (2D grid, not linear list) - Click toggles open/closed, locks against hover dismiss - Escape closes and returns focus to trigger - Hover as progressive enhancement (show with skipAutoFocus) Visual: - Both have chevron with rotation animation - triggerOpen style for active state (matches XDSTopNavItem selected) - Menu: popover styling (background, shadow, border-radius, padding, 4px offset) - MegaMenu: transparent layer background, panelContainer provides visual style - Removed isSingleColumn prop — responsive grid handles it Layout: - MegaMenu: flex-wrap 2:1 ratio (items + featured), XDSGrid for inner items - Featured wraps below at narrow widths - Removed divider div — grid gap provides separation Shell Lab: - Independent superheading/subheading toggles for SideNav heading - All four AppShell variant options Also: - useXDSHoverCard: exposed show/hide methods - Removed isSingleColumn from sandbox mega-menu demo Part of #565
cixzhang
force-pushed
the
navi/fix/mega-menu-positioning
branch
from
March 15, 2026 21:28
e022230 to
43afe8e
Compare
52 of 55 tasks
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
… focus trapping (#622) Mega menu + menu overhaul addressing #565 findings: Positioning: - MegaMenu: anchor to parent <nav> via useXDSPopover - Menu: anchor to trigger button via useXDSPopover - Both: slot-aware alignment via TopNavSlotContext - Removed anchorStretch override and position:relative wrapper requirement Focus & Keyboard: - Both use useXDSPopover for focus trapping (tab cycles within menu) - Menu uses useListFocus for arrow key navigation between items - MegaMenu uses tab navigation (2D grid, not linear list) - Click toggles open/closed, locks against hover dismiss - Escape closes and returns focus to trigger - Hover as progressive enhancement (show with skipAutoFocus) Visual: - Both have chevron with rotation animation - triggerOpen style for active state (matches XDSTopNavItem selected) - Menu: popover styling (background, shadow, border-radius, padding, 4px offset) - MegaMenu: transparent layer background, panelContainer provides visual style - Removed isSingleColumn prop — responsive grid handles it Layout: - MegaMenu: flex-wrap 2:1 ratio (items + featured), XDSGrid for inner items - Featured wraps below at narrow widths - Removed divider div — grid gap provides separation Shell Lab: - Independent superheading/subheading toggles for SideNav heading - All four AppShell variant options Also: - useXDSHoverCard: exposed show/hide methods - Removed isSingleColumn from sandbox mega-menu demo Part of #565
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
… focus trapping (#622) Mega menu + menu overhaul addressing #565 findings: Positioning: - MegaMenu: anchor to parent <nav> via useXDSPopover - Menu: anchor to trigger button via useXDSPopover - Both: slot-aware alignment via TopNavSlotContext - Removed anchorStretch override and position:relative wrapper requirement Focus & Keyboard: - Both use useXDSPopover for focus trapping (tab cycles within menu) - Menu uses useListFocus for arrow key navigation between items - MegaMenu uses tab navigation (2D grid, not linear list) - Click toggles open/closed, locks against hover dismiss - Escape closes and returns focus to trigger - Hover as progressive enhancement (show with skipAutoFocus) Visual: - Both have chevron with rotation animation - triggerOpen style for active state (matches XDSTopNavItem selected) - Menu: popover styling (background, shadow, border-radius, padding, 4px offset) - MegaMenu: transparent layer background, panelContainer provides visual style - Removed isSingleColumn prop — responsive grid handles it Layout: - MegaMenu: flex-wrap 2:1 ratio (items + featured), XDSGrid for inner items - Featured wraps below at narrow widths - Removed divider div — grid gap provides separation Shell Lab: - Independent superheading/subheading toggles for SideNav heading - All four AppShell variant options Also: - useXDSHoverCard: exposed show/hide methods - Removed isSingleColumn from sandbox mega-menu demo Part of #565
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
… focus trapping (#622) Mega menu + menu overhaul addressing #565 findings: Positioning: - MegaMenu: anchor to parent <nav> via useXDSPopover - Menu: anchor to trigger button via useXDSPopover - Both: slot-aware alignment via TopNavSlotContext - Removed anchorStretch override and position:relative wrapper requirement Focus & Keyboard: - Both use useXDSPopover for focus trapping (tab cycles within menu) - Menu uses useListFocus for arrow key navigation between items - MegaMenu uses tab navigation (2D grid, not linear list) - Click toggles open/closed, locks against hover dismiss - Escape closes and returns focus to trigger - Hover as progressive enhancement (show with skipAutoFocus) Visual: - Both have chevron with rotation animation - triggerOpen style for active state (matches XDSTopNavItem selected) - Menu: popover styling (background, shadow, border-radius, padding, 4px offset) - MegaMenu: transparent layer background, panelContainer provides visual style - Removed isSingleColumn prop — responsive grid handles it Layout: - MegaMenu: flex-wrap 2:1 ratio (items + featured), XDSGrid for inner items - Featured wraps below at narrow widths - Removed divider div — grid gap provides separation Shell Lab: - Independent superheading/subheading toggles for SideNav heading - All four AppShell variant options Also: - useXDSHoverCard: exposed show/hide methods - Removed isSingleColumn from sandbox mega-menu demo Part of #565
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major overhaul of both
XDSTopNavMegaMenuandXDSTopNavMenu, making them consistent with each other and fully accessible.Both Menus
Focus Trapping (useXDSPopover)
useXDSPopoverfor focus trapping — tab cycles within the menuXDSTopNavMenuaddsuseListFocusfor arrow key navigation (linear list)XDSTopNavMegaMenuuses tab navigation (2D grid)Hover + Click Interaction
popover.show({skipAutoFocus: true})— no focus stealtriggerOpenactive stateSlot-Aware Alignment
TopNavSlotContext— TopNav wraps each slot in a context provideralignmentto popoverposition-areafollows the nav item placement automaticallyXDSTopNavMegaMenu
Positioning
<nav>for full-width panelsposition: relativewrapper requirementResponsive Layout
flex: 2 1 300px, featuredflex: 1 1 200px)XDSGrid columns={2} minChildWidth={200}panelContainerprovides visual styleRemoved
isSingleColumnprop (responsive grid replaces it)anchorStretchstyleXDSTopNavMenu
Changes
useXDSHoverCardtouseXDSPopover+ hover enhancementuseListFocusOther
useXDSHoverCard: exposedshow/hidemethodsisSingleColumnfrom sandbox mega-menu demoTest plan
Part of #565