Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Prevent block UI from showing above settings panel on mobile #67176

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

sarthaknagoshe2002
Copy link
Contributor

Fixes: #63845

What?

This PR addresses an issue where interacting with the block settings panel on mobile reveals the underlying UI of blocks. Specifically:

  1. Adjusting the padding displays the blue margin indicators.
  2. Adjusting the height of the Cover block (and similar blocks like Spacer) reveals underlying UI elements.

Why?

When interacting with the settings panel, users should only see and interact with the settings themselves. Showing the block UI underneath is confusing and can lead to unintended actions or distractions. This behavior affects usability and creates a suboptimal user experience on mobile devices.

How?

Added a media query for mobile devices to the .components-popover.block-editor-block-popover class, setting z-index: -1 when the viewport width is below $break-medium. This ensures the popover doesn't overlay or interact with elements improperly on smaller screens.

Testing Instructions

  1. Create a new post on mobile
  2. Adjust the padding and set the height of the cover block
  3. The underlying UI of the block doesn't show up above the settings panel

Copy link

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: sarthaknagoshe2002 <[email protected]>
Co-authored-by: annezazu <[email protected]>
Co-authored-by: mrfoxtalbot <[email protected]>

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

@adamsilverstein adamsilverstein added the [Type] Bug An existing feature does not function as intended label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Mobile] Block Settings Panel should prevent interaction with blocks beneath it
2 participants