Flex Layout
: Incorrect
default alignment value used in Vertical Alignment Control
Component
#68864
Open
3 of 6 tasks
Labels
[Feature] Layout
Layout block support, its UI controls, and style output.
[Package] Block editor
/packages/block-editor
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
Originally discovered by @luisherranz while testing here #68112 (review) and splitting it from the
enhancement
as this is an existing bug.gutenberg/packages/block-editor/src/layouts/flex.js
Lines 202 to 205 in f14a977
Here, the default value of vertical alignment when the orientation is set to
vertical
is essentiallyverticalAlignmentMap.top
which resolves toflex-start
, which is not acceptable for theToolbar
. This causes the default value to remain unselected within theVertical Alignment Toolbar
.Acceptable values:
gutenberg/packages/block-editor/src/layouts/flex.js
Line 222 in f14a977
gutenberg/packages/block-editor/src/layouts/flex.js
Lines 146 to 147 in f14a977
It's expected that
layout.verticalAlignment
holds the key instead of the value, failing to do so causes the bug mentioned above (No default alignment value being rendered on the toolbar when the orientation is set to columns).I searched the issue repository but couldn’t find a similar report. Please feel free to close this if it’s a duplicate.
Step-by-step reproduction instructions
Row
block.Alignment
in theToolbar
is set asAlign middle
.Row
to aColumn
block.Alignment
value within theToolbar
is missing, whereas, it should have been selected asTop
.Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: