Skip to content

Cover Block: fix position push out by preceding floated blocks#79075

Open
BugReportOnWeb wants to merge 1 commit into
WordPress:trunkfrom
BugReportOnWeb:fix/cover-block-clear-float-alignment
Open

Cover Block: fix position push out by preceding floated blocks#79075
BugReportOnWeb wants to merge 1 commit into
WordPress:trunkfrom
BugReportOnWeb:fix/cover-block-clear-float-alignment

Conversation

@BugReportOnWeb

Copy link
Copy Markdown
Contributor

What?

Closes #73691

This PR fixes an issue where a Cover block can be pushed out of position by a preceding floated block.

Why?

Blocks aligned left or right (alignleft / alignright) use CSS floats. When a Cover block is aligned as alignwide or alignfull, it does not currently clear preceding floats. As a result, the Cover block may be rendered alongside the floated element instead of starting below it.

How?

Adds clear: both to .wp-block-cover when combined with .alignwide or .alignfull. This ensures the Cover block is rendered below any preceding floated block and maintains its intended alignment.

Testing Instructions

  1. Create a new post.
  2. Insert an Image block and set its alignment to Align left.
  3. Insert a second Image block and set its alignment to Wide width.
  4. Verify that the second image renders below the first image.
  5. Transform the second Image block into a Cover block.
  6. Verify that the Cover block is also below the floated image rather than beside it.

Screenshots or screencast

Before After
Screenshot 2026-06-10 at 12 41 23 PM Screenshot 2026-06-10 at 12 41 48 PM

Use of AI Tools

ChatGPT for refining the PR description

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jun 10, 2026
@BugReportOnWeb BugReportOnWeb marked this pull request as ready for review June 10, 2026 08:38
@github-actions

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block library.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

1 similar comment
@github-actions

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block library.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: BugReportOnWeb <devasheeshkaul@git.wordpress.org>
Co-authored-by: krokodok <krokodok@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alignment left and right (float) break some blocks like Cover

1 participant