Skip to content

Navigation Block: Overlay Z-index nesting issues with consecutive cover blocks #75439

Open

Description

@NoHopeRadio

_This is a core issue: https://github.com/WordPress/gutenberg/issues/45353_
Feel free to use this issue for tracking WordPress.com Customer reports. - cuemarie


Quick summary

If a navigation block is nested in a cover block, and there is a cover block after it on the page, the contents of the second cover block will show on top of the navigation overlay.

Both the header and content immediately after are in cover blocks here:

image

In this case, when expanded, the navigation overlay sits underneath the second cover block.

image

If there is an image in the second cover block...

image

...the navigation overlay will overlap the image, but not the overlay or the text.

image

Setting a background color for the cover block creates an opaque overlay, so that does completely cover the navigation section.

image

If the navigation block is not within a cover block...

image

then the overlay loads correctly.

image

Steps to reproduce

  1. Create a navigation menu within a cover block.
  2. Enable the overlay option for the menu.
  3. Create a cover block as the next element on the page, add text and overlay to this block.
  4. Expand Navigation hamburger.

What you expected to happen

The navigation menu should become the top element on the page.

What actually happened

The navigation overlay sits underneath the second cover block's overlay. I believe the z-index settings of the navigation block's parent cover block overlay take precedence over the navigation block's settings here.

Setting the z-index for the cover block's inner content as a number greater than 1 seems to fix the issue. Since this is generally the first cover block on the page, a CSS workaround that might work is:

.wp-block-cover .wp-block-cover__inner-container:first-of-type, .wp-block-cover-image .wp-block-cover__inner-container:first-of-type { 
z-index: 2;
}

Otherwise, a different layout for the second element of the page or the header may be necessary.

Noticed in ticket here:
6174732-zen

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

No response

Logs or notes

No response

Activity

  1. added
    BugWhen a feature is broken and / or not performing as intended
    on Apr 7, 2023
  2. github-actions commented on Apr 7, 2023

    @github-actions

    Support References

    This comment is automatically generated. Please do not edit it.

    • 6174732-zen
    • 6223970-zen
    • 6737383-zen
    • 7374639-zen
    • 7396302-zen
    • 7707902-zen
    • 7790193-zen
    • 7960428-zen
    • 8164886-zen
    • 8849232-zen
    • 9291659-zen
    • 9364248-zen
  3. cuemarie commented on Apr 7, 2023

    @cuemarie

    📌 SCRUBBING : RESULT - Replicated / Could Not Replicate / Uncertain

    • Tested on Simple – Replicated
    • Tested on Atomic – Replicated
    • Replicable outside of Dotcom – Yes

    📌 FINDINGS/SCREENSHOTS/VIDEO

    • Replicated in all test environments! Even without a second Cover block following the first, it seems like the Navigation Block, when inside of a Cover block, runs into z-index issues in the Editor as well.

    Screenshots/Recordings

    Nav block OUTSIDE of cover block, in Editor
    Markup on 2023-04-07 at 13:46:26

    Nav block INSIDE of cover block, in Editor
    Markup on 2023-04-07 at 13:47:03

    Live Site
    Markup on 2023-04-07 at 13:56:09


    Nav block INSIDE of cover block, in Editor, no 2nd cover block

    • NOTE - this behavior did not occur on my selfhosted site using Gutenberg 15.5.0, but the issues with other cover blocks (as noted above) did happen there as well.

    Markup on 2023-04-07 at 13:48:02

    Live Site
    Markup on 2023-04-07 at 13:59:02

    📌 ACTIONS

  4. added
    [Pri] NormalSchedule for the next available opportuinity.
    [Status] Core Fix NeededA fix within the Core WordPress or Gutenberg project is required to resolve this issue.
    TriagedTo be used when issues have been triaged.
    BlocksEditor blocks, aka Gutenberg blocks, plugins, and extensions
    and removed
    [Pri] LowAddress when resources are available.
    on Apr 7, 2023
  5. Gustavo-Hilario commented on Apr 25, 2023

    @Gustavo-Hilario
    Contributor

    Another report here: 6223970-zen
    Theme: Blank Canvas

    I could reproduce this on a test site. In this case, the submenu is getting cut off at the bottom of the cover block.

    Markup 2023-04-25 at 06 24 40

  6. masperber commented on May 3, 2023

    @masperber
    Contributor

    38262835-hc I had a customer report the same issue that @Gustavo-Hilario reported. That is: when a Navigation Block is nested inside of a Cover Block, the submenu is cut off at the bottom of the Cover Block.

  7. 21 remaining items

  8. nazilya06 commented on Oct 10, 2024

    @nazilya06

    Another report: 8849232-zd-a8c

    Advised to replace the Cover block behind the Nav menu with a Group block. Then add a Background image to the Group block.

  9. removed
    GroundskeepingIssues handled through Dotcom Groundskeeping rotations
    on Oct 14, 2024
  10. davemart-in commented on Oct 14, 2024

    @davemart-in
    Contributor

    Removing groundskeeper label since this has been picked up.

  11. renatho commented on Oct 17, 2024

    @renatho
    Contributor
  12. moved this from Still Relevant to Fixed / Has PR in Dotcom Core Fix Neededon Jan 16, 2025
  13. nazilya06 commented on Jan 16, 2025

    @nazilya06

    User reported same issue here: 9291659-zd-a8c. Reopened the bug report. I was able to replicate the same behavior on my test site.

    Same as described by @Gustavo-Hilario here.

  14. added
    [Interaction #] > 10(Automated) interaction count label for better visibility. Please don't add these manualliy.
    on Jan 16, 2025
  15. happychait commented on Feb 3, 2025

    @happychait
    Contributor

    A user encountered the same issue in 9364248-zen

    Worked around by transforming the Cover blocks to Group blocks.

  16. removed
    TriagedTo be used when issues have been triaged.
    on Sep 3, 2025
  17. removed
    Customer report [LEGACY]Issues or PRs that were reported via Happiness. Previously known as "Happiness Request".
    on Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugWhen a feature is broken and / or not performing as intendedNavigation[Feature Group] Editor ExperienceFeatures related to Gutenberg integration on WordPress.com.[Feature] Core BlocksBlocks that come with Gutenberg.[Interaction #] > 10(Automated) interaction count label for better visibility. Please don't add these manualliy.[Platform] Atomic[Platform] Simple[Pri] NormalSchedule for the next available opportuinity.[Product] WordPress.comAll features accessible on and related to WordPress.com.[Status] Core Fix NeededA fix within the Core WordPress or Gutenberg project is required to resolve this issue.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions