Skip to content

Navigation block: overlapping(z-index) issue when nested inside Cover Block #79317

Closed

Description

@Robertght

Quick summary

While having an overlay menu opened, the slideshow block shows up on top of the overlay.

Steps to reproduce

  1. Activate a block theme(tested with Blank Canvas, 2023, Quadrat)
  2. Open the default page template
  3. Set a Cover block in the header with a smaller height. (20-40vh)
  4. Set the navigation block's overlay menu to "alaway".
  5. After the header template part, add a slideshow block(or multiple, I don't judge)
  6. Publish the changes and open the menu

What you expected to happen

To see the navigation menu correctly

What actually happened

This happened: Xq6sxq.png (yes that image is from the slideshow)

Browser

Google Chrome/Chromium, Mozilla Firefox, Microsoft Edge

Context

No response

Platform (Simple, Atomic, or both?)

Simple

Other notes

Found that in Slack while trying to help with CSS: p1687930863677319-slack-C03TY6J1A

I only tested this on Simple websites and on a Pressable website.
The issue only manifested on the Simple sites, using the same themes.

Reproducibility

Consistent

Severity

Some (< 50%)

Available workarounds?

Yes, difficult to implement

Workaround details

CSS is the only thing I could suggest.

The most straightforward method is to add a class to the cover block, then add this CSS. If "fixclipping" is the class, add:

.fixclipping {
	overflow: visible;
}

Or you can select in other ways. In Slack we used:

/* adjust the z-index on the slideshow | xxxxxx-zen */
.wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container {
	z-index: 99999;
}

(edited to add the class method since the other wasn't working consistently for me)

Activity

  1. added
    [Pri] TBDReview and assign an appropriate [Pri] label as soon as possible.
    on Jul 10, 2023
  2. github-actions commented on Jul 10, 2023

    @github-actions

    Support References

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

    • -zen
    • 7228873-zen
    • 7277570-zen
    • 7825401-zen
    • 8082235-zen
    • 8173661-zen
    • 8380863-zen
    • 8702470-zen
    • 8715843-zen
    • 8772803-zen
  3. added
    [Pri] NormalSchedule for the next available opportuinity.
    and removed
    [Pri] TBDReview and assign an appropriate [Pri] label as soon as possible.
    on Jul 12, 2023
  4. transferred this issue fromAutomattic/themeson Jul 12, 2023
  5. cuemarie commented on Jul 12, 2023

    @cuemarie

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

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

    📌 FINDINGS/SCREENSHOTS/VIDEO

    • The problem only appears when the Nav Block is placed inside a Cover block (the height of the cover block has no impact on the behavior). The z-index of the Slideshow and the Nav block are as follows in both setups:

    wp-block-jetpack-slideshow_container

    .swiper-container {
         z-index: 1;
    }
    

    wp-block-navigation__responsive-container hidden-by-default has-modal-open is-menu-open

    .wp-block-navigation__responsive-container.is-menu-open {
         z-index: 100000;
    }
    

    The Cover block is the key difference, and the cover block also has a z-index: 1, and that z-index is likely what's causing problems. There are a few open issues about this in /gutenberg such as:

    Screenshots/Recordings

    Simple Site, with Nav Block inside Cover Block:
    Markup on 2023-07-12 at 12:48:25

    Same site without Cover Block:
    Markup on 2023-07-12 at 12:48:41

    📌 ACTIONS

    • Assigned to Other
    • Added to ‘HE Cross-repo Watchlist’ project board
  6. added
    [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.
    and removed
    Needs triageTicket needs to be triaged
    on Jul 12, 2023
  7. changed the title [-]Navigation block/Cover block & Slideshow block: overlapping(z-index) issue[/-] [+]Navigation block: overlapping(z-index) issue when nested inside Cover Block[/+] on Aug 3, 2023
  8. 6 remaining items

  9. vinnykaur commented on May 3, 2024

    @vinnykaur

    One more: 8082235-zd-a8c

  10. upwardmomentum84 commented on May 11, 2024

    @upwardmomentum84
    Contributor

    Related issue: 8173661-zd-a8c

    The submenu on mobile was being overlayed by the Cover block below it. I added a CSS class to set the Cover block that contained the menu to have a high z-index and this resolved it.

  11. hngdny commented on Jul 1, 2024

    @hngdny

    Related issue: 8380863-zd-a8c

    Used the workaround to set custom CSS class + high Z-index

  12. supernovia commented on Sep 12, 2024

    @supernovia
    Contributor

    We have a case here:
    8702470-zd-a8c -- user isn't actually doing anything with the cover block anymore, so I'd recommended not using it and reverting back to a version that works, but we can add the CSS if user responds affirming they want it

  13. mrfoxtalbot commented on Sep 13, 2024

    @mrfoxtalbot

    As a workaround, we can recommend users they replace their cover block with a group block, now that group blocks support background images. I tested it and the dropdown menu shows outside the group block without any issues:

    Kapture.2024-09-13.at.15.08.41.mp4
  14. supernovia commented on Sep 17, 2024

    @supernovia
    Contributor

    I've got another case here.
    8715843-zd-a8c

  15. supernovia commented on Sep 17, 2024

    @supernovia
    Contributor

    As a workaround, we can recommend users they replace their cover block with a group block, now that group blocks support background images. I tested it and the dropdown menu shows outside the group block without any issues:

    I've just tested this on a simple site + personal plan; alas I couldn't get it to work.

  16. supernovia commented on Oct 2, 2024

    @supernovia
    Contributor

    Another case here: 8772803-zd-a8c

  17. supernovia commented on Oct 7, 2024

    @supernovia
    Contributor

    This might be a duplicate or likeness of this issue:
    #75439

  18. self-assigned this
    on Oct 8, 2024
  19. renatho commented on Oct 8, 2024

    @renatho
    Contributor

    This might be a duplicate or likeness of this issue: #75439

    Yes! I just checked that the issue with the Slideshow is also fixed with the same PR.

  20. renatho commented on Oct 8, 2024

    @renatho
    Contributor

    As suggested by @supernovia it's duplicate (#75439), so I'm closing it.

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 intendedCustomer report [LEGACY]Issues or PRs that were reported via Happiness. Previously known as "Happiness Request".TriagedTo be used when issues have been triaged.[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.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions