-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Flex Layout: Fix incorrect default alignment values for Vertical Alignment Control component
#68866
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
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
7e9a4f1 to
9911076
Compare
38ce8a9 to
5e01c20
Compare
|
I noticed that this bug is still unresolved on trunk. Here's more context on the proposed changes to help this PR move forward. Within
The value of gutenberg/packages/block-editor/src/layouts/flex.js Lines 202 to 205 in a5d2887
When the orientation is
However, gutenberg/packages/block-editor/src/components/block-vertical-alignment-control/ui.js Line 15 in a5d2887
This can be seen in the UI as well, when a row block is transformed to stack, the default value is not shown as selected in the UI.
We cannot update Hi @t-hamano, |
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yogeshbhutkar Thanks for the PR!
To understand the problem exactly, let me confirm one thing.
This problem does not occur in horizontal layout, i.e. Row block, and "Align middle" is selected as the default value correctly. The reason for this is that the default vertical alignment in the horizontal layout is "center", and the key name and value in the verticalAlignmentMap object were the same, so fortunately, no problems occurred.
I my understanding correct?
50a74f4 to
1eeed49
Compare
Yes, exactly. |
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes make sense to me 👍
…gnment Control` component (WordPress#68866) * Flex Layout: Fix incorrect default alignment values for `Vertical Alignment Control` component * chore: fix casing of `defaultAlignments` Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>


What, Why and How?
Fixes: #68864
This PR addresses a bug in which the default
vertical alignmentvalue does not render as selected in the Vertical Alignment Toolbar when the orientation is set to vertical. The issue arises because thelayout.verticalAlignmentproperty 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
Row Block.Block Toolbarthat the default alignment value isAlign middle.Blockto aColumnblock.Top.Screencast
Screen.Recording.2025-01-24.at.12.17.01.PM.mov
Screenshots