Skip to content

Commit

Permalink
Fix issue where align support is boolean.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Feb 23, 2024
1 parent 87aa4bb commit da5d397
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,26 @@ export default function ChildLayoutControl( {

const {
current: currentAlignment,
supported: supportedAlignments,
supported,
onChangeAlignment,
} = alignments || {};

/**
* If supported alignments is true, it means that the block supports
* both wide and full alignments. If false, it supports neither.
*/
let supportedAlignments;
switch ( supported ) {
case true:
supportedAlignments = [ 'wide', 'full' ];
break;
case false:
supportedAlignments = [];
break;
default:
supportedAlignments = supported;
}

const {
orientation = 'horizontal',
type: parentType,
Expand Down

0 comments on commit da5d397

Please sign in to comment.