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

Block Editor: Prevent negative width values in Spacer block when used inside a row block #68845

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

himanshupathak95
Copy link
Contributor

@himanshupathak95 himanshupathak95 commented Jan 23, 2025

Fixes: #68847 (Point 1)

What?

Prevent negative width values in the Spacer block when used inside Row blocks.

Why?

Currently, when a Spacer block is placed in a Row block, it can accept negative width values, which is not ideal.

Testing Instructions

  • Create or open a post/page
  • Add a Row block
  • Insert a Spacer block inside the Row
  • Try to set a negative width value using the resize handle
  • Verify that the minimum width remains at 0

Screencast

Before

Screen.Recording.2025-01-23.at.13.00.11.mov

After

Screen.Recording.2025-01-23.at.12.59.23.mov

@himanshupathak95 himanshupathak95 marked this pull request as ready for review January 23, 2025 09:00
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: himanshupathak95 <[email protected]>
Co-authored-by: yogeshbhutkar <[email protected]>

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

@carolinan carolinan added [Block] Spacer Affects the Spacer Block [Type] Bug An existing feature does not function as intended labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Spacer Affects the Spacer Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility: Spacer Block's width attribute accepts and saves negative value
2 participants