Skip to content

Commit

Permalink
Fix default control selection
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Apr 24, 2023
1 parent 6a91fe5 commit ae30c09
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/block-editor/src/layouts/flex.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,7 @@ function FlexLayoutVerticalAlignmentControl( {
} ) {
const { orientation = 'horizontal' } = layout;

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

const { verticalAlignment = defaultVerticalAlignment } = layout;
const { verticalAlignment = 'top' } = layout;

const onVerticalAlignmentChange = ( value ) => {
onChange( {
Expand Down Expand Up @@ -264,7 +259,10 @@ function FlexLayoutJustifyContentControl( {
onChange,
isToolbar = false,
} ) {
const { justifyContent = 'left', orientation = 'horizontal' } = layout;
const { orientation = 'horizontal' } = layout;
const defaultJustification =
orientation === 'horizontal' ? 'left' : 'stretch';
const { justifyContent = defaultJustification } = layout;
const onJustificationChange = ( value ) => {
onChange( {
...layout,
Expand Down

0 comments on commit ae30c09

Please sign in to comment.