Skip to content

Commit

Permalink
Flex Layout: Fix incorrect default alignment values for `Vertical Ali…
Browse files Browse the repository at this point in the history
…gnment Control` component
  • Loading branch information
yogeshbhutkar committed Jan 28, 2025
1 parent 2abe6fa commit 9911076
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/block-editor/src/layouts/flex.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ const verticalAlignmentMap = {
'space-between': 'space-between',
};

const DEFAULT_ALIGNMENT = {
horizontal: 'center',
vertical: 'top',
};

const flexWrapOptions = [ 'wrap', 'nowrap' ];

export default {
Expand Down Expand Up @@ -201,8 +206,8 @@ function FlexLayoutVerticalAlignmentControl( { layout, onChange } ) {

const defaultVerticalAlignment =
orientation === 'horizontal'
? verticalAlignmentMap.center
: verticalAlignmentMap.top;
? DEFAULT_ALIGNMENT.horizontal
: DEFAULT_ALIGNMENT.vertical;

const { verticalAlignment = defaultVerticalAlignment } = layout;

Expand Down

0 comments on commit 9911076

Please sign in to comment.