Repository navigation
fix(topnav): mega menu backdrop no longer covers nav items - #377
Merged
Merged
Conversation
The XDSTopNavMegaMenu backdrop (z-index 99) visually covered nav bar items since they had no stacking context. Added position: relative and zIndex: 100 to XDSTopNav base style so nav content renders above the backdrop while the mega menu panel still paints on top. Co-authored-by: Navi <[email protected]>
rubyycheung
enabled auto-merge
February 27, 2026 03:45
rubyycheung
added this pull request to the merge queue
Feb 27, 2026
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsTopNav · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Component PreviewsIncludes interactive hover previews as animated GIFs. XDSTopNavDefaultScreenshot: Interaction Preview: (view video) View in Storybook · Centered With Start ContentScreenshot: View in Storybook · Center Content Without EndScreenshot: View in Storybook · Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
rubyycheung
added a commit
that referenced
this pull request
Feb 27, 2026
…ment PR #377 incorrectly added position:relative + z-index to the <nav> element, which made it the positioned ancestor for the MegaMenu backdrop — breaking the unified card visual. The correct fix is to add the stacking context to the nav's content sections (leftSection, centerContent, rightSection, endContent) so they sit above the backdrop (z-index 99) while the backdrop still positions relative to the outer wrapper. Co-authored-by: Navi <[email protected]>
rubyycheung
added a commit
that referenced
this pull request
Feb 27, 2026
The MegaMenu backdrop div was intended to create a unified card appearance by overlaying the nav area with a white background, shadow, and rounded corners. However, because the backdrop lives inside the nav DOM tree, it inevitably covers the nav items regardless of z-index workarounds. Removed the backdrop entirely. The unified card look is achieved by: - The navWrapper providing top rounded corners and shadow - The panel providing bottom rounded corners and its own shadow Also reverted the stacking context workarounds from #377 that were added to XDSTopNav sections (no longer needed without the backdrop). Co-authored-by: Navi <[email protected]>
This was referenced Mar 3, 2026
cixzhang
pushed a commit
that referenced
this pull request
Apr 26, 2026
The XDSTopNavMegaMenu backdrop (z-index 99) visually covered nav bar items since they had no stacking context. Added position: relative and zIndex: 100 to XDSTopNav base style so nav content renders above the backdrop while the mega menu panel still paints on top. Co-authored-by: Navi <[email protected]>
cixzhang
pushed a commit
that referenced
this pull request
Apr 26, 2026
…ment (#378) PR #377 incorrectly added position:relative + z-index to the <nav> element, which made it the positioned ancestor for the MegaMenu backdrop — breaking the unified card visual. The correct fix is to add the stacking context to the nav's content sections (leftSection, centerContent, rightSection, endContent) so they sit above the backdrop (z-index 99) while the backdrop still positions relative to the outer wrapper. Co-authored-by: Navi <[email protected]>
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
The XDSTopNavMegaMenu backdrop (z-index 99) visually covered nav bar items since they had no stacking context. Added position: relative and zIndex: 100 to XDSTopNav base style so nav content renders above the backdrop while the mega menu panel still paints on top. Co-authored-by: Navi <[email protected]>
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
…ment (#378) PR #377 incorrectly added position:relative + z-index to the <nav> element, which made it the positioned ancestor for the MegaMenu backdrop — breaking the unified card visual. The correct fix is to add the stacking context to the nav's content sections (leftSection, centerContent, rightSection, endContent) so they sit above the backdrop (z-index 99) while the backdrop still positions relative to the outer wrapper. Co-authored-by: Navi <[email protected]>
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
The XDSTopNavMegaMenu backdrop (z-index 99) visually covered nav bar items since they had no stacking context. Added position: relative and zIndex: 100 to XDSTopNav base style so nav content renders above the backdrop while the mega menu panel still paints on top.
cixzhang
pushed a commit
that referenced
this pull request
Jun 21, 2026
…ment (#378) PR #377 incorrectly added position:relative + z-index to the <nav> element, which made it the positioned ancestor for the MegaMenu backdrop — breaking the unified card visual. The correct fix is to add the stacking context to the nav's content sections (leftSection, centerContent, rightSection, endContent) so they sit above the backdrop (z-index 99) while the backdrop still positions relative to the outer wrapper.
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.
Problem
The
XDSTopNavMegaMenubackdrop div (z-index: 99) visually covers the nav bar items when the mega menu opens. The backdrop creates a unified card appearance by overlaying the entire positioned ancestor, but the nav items have no z-index and render behind it — making them invisible.Fix
Added
position: relativeandzIndex: 100to theXDSTopNavbase style. This creates a stacking context for the nav bar so its content renders above the backdrop (99) while the mega menu panel (100, later in DOM order) still paints on top.Test Plan
position: relativeandz-index >= 100