Skip to content

Cover Block: Fix placeholder interaction in contentOnly mode#70157

Merged
Mamaduka merged 3 commits intoWordPress:trunkfrom
Sukhendu2002:fix/cover-block-contentonly-mode
Aug 11, 2025
Merged

Cover Block: Fix placeholder interaction in contentOnly mode#70157
Mamaduka merged 3 commits intoWordPress:trunkfrom
Sukhendu2002:fix/cover-block-contentonly-mode

Conversation

@Sukhendu2002
Copy link
Contributor

@Sukhendu2002 Sukhendu2002 commented May 19, 2025

What?

Part of: #65778

This PR fixes the Cover block's behavior in contentOnly mode by:

  • Making the initial placeholder interactive in contentOnly mode
  • Hiding non-content controls (content position and full height) when not in default editing mode

Testing Instructions

  1. Create a Group block
  2. Set the Group block's templateLock attribute to "contentOnly"
  3. Insert a Cover block inside the group
    Verify that:
  4. You can interact with the Cover block's placeholder to add media
  5. The "Change content position" and "Full height" controls are not visible in the toolbar

Screenshots or screencast

Before:

Screen.Recording.2025-05-21.at.3.54.12.PM.mov

After:

Screen.Recording.2025-05-19.at.11.57.13.AM.mov

@Sukhendu2002 Sukhendu2002 marked this pull request as ready for review May 19, 2025 07:07
@github-actions
Copy link

github-actions bot commented May 19, 2025

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: Sukhendu2002 <sukhendu2002@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Cover Affects the Cover Block - used to display content laid over a background image labels May 20, 2025
@Mamaduka
Copy link
Member

Thanks for working on this, @Sukhendu2002!

For similar PRs, it is always nice to have a before/after screencast, which makes it easy for reviewers to visually compare changes.

@Sukhendu2002
Copy link
Contributor Author

Thanks for the suggestion! I’ll add a before/after screencast for this and similar PRs.

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me. Thanks, @Sukhendu2002!

@Mamaduka Mamaduka merged commit 8e09d2e into WordPress:trunk Aug 11, 2025
67 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.5 milestone Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Cover Affects the Cover Block - used to display content laid over a background image [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants