Skip to content

Cover Block + Sticky Group + Navigation block #69635

@scruffian

Description

@scruffian

What problem does this address?

If you place a navigation block inside a sticky position block, inside a cover block, the navigation overlay gets cut off in Safari.

For example, using this block markup:

<!-- wp:cover {"dimRatio":50,"overlayColor":"contrast","isUserOverlayColor":true,"minHeight":20,"minHeightUnit":"vw","isDark":false,"sizeSlug":"full","layout":{"type":"constrained"}} -->
<div class="wp-block-cover is-light" style="min-height:20vw"><span aria-hidden="true" class="wp-block-cover__background has-contrast-background-color has-background-dim"></span><div class="wp-block-cover__inner-container"><!-- wp:group {"style":{"position":{"type":"sticky","top":"0px"}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:navigation {"ref":2429} /--></div>
<!-- /wp:group --></div></div>
<!-- /wp:cover -->
With formatting
<!-- wp:cover {"dimRatio":50,"overlayColor":"contrast","isUserOverlayColor":true,"minHeight":20,"minHeightUnit":"vw","isDark":false,"sizeSlug":"full","layout":{"type":"constrained"}} -->
<div class="wp-block-cover is-light" style="min-height:20vw">
    <span aria-hidden="true" class="wp-block-cover__background has-contrast-background-color has-background-dim"></span>
    <div class="wp-block-cover__inner-container">
        <!-- wp:group {"style":{"position":{"type":"sticky","top":"0px"}},"layout":{"type":"constrained"}} -->
        <div class="wp-block-group">
            <!-- wp:navigation {"ref":2429} /-->
        </div>
        <!-- /wp:group -->
    </div>
</div>
<!-- /wp:cover -->

When you open the navigation menu in Safari, is it clipped by the cover block like this:
Image

What is your proposed solution?

The problem is the overflow: clip which was added in #59388. I'm not sure if there's a good workaround though.

This is actually a more general issue with the way that Safari handles clip vs hidden. You can see that using this markup:

<div style="background: red; overflow: clip; height: 100px;">
    <div style="position: sticky;">
      <div style="background: blue; position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100% height: 100%;"></div>
    </div>
</div>

Metadata

Metadata

Assignees

Labels

[Block] CoverAffects the Cover Block - used to display content laid over a background image[Block] NavigationAffects the Navigation Block[Status] In ProgressTracking issues with work in progress

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions