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

Flex Layout: Fix incorrect default alignment values for Vertical Alignment Control component #68866

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

Conversation

yogeshbhutkar
Copy link
Contributor

@yogeshbhutkar yogeshbhutkar commented Jan 24, 2025

What, Why and How?

Fixes: #68864

This PR addresses a bug in which the default vertical alignment value does not render as selected in the Vertical Alignment Toolbar when the orientation is set to vertical. The issue arises because the layout.verticalAlignment property is expected to store the alignment key (e.g., top, center, bottom, stretch, etc.) but instead holds the resolved CSS value (e.g., flex-start).

Testing Instructions

  1. Create a Row Block.
  2. Verify from the Block Toolbar that the default alignment value is Align middle.
  3. Convert the same Block to a Column block.
  4. Confirm that the default alignment value for is now appropriately set to Top.

Screencast

Screen.Recording.2025-01-24.at.12.17.01.PM.mov

Screenshots

Before After
before after

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: yogeshbhutkar <[email protected]>

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] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor [Feature] Layout Layout block support, its UI controls, and style output. labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flex Layout: Incorrect default alignment value used in Vertical Alignment Control Component
2 participants