Skip to content

Commit

Permalink
Fix display of width controls for legacy layouts (#43688)
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines authored Aug 31, 2022
1 parent 6fbfd6b commit 5b48607
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) {

const constrainedType = getLayoutType( 'constrained' );

const displayControlsForLegacyLayouts =
! usedLayout.type && ( contentSize || inherit );

const onChangeType = ( newType ) =>
setAttributes( { layout: { type: newType } } );
const onChangeLayout = ( newLayout ) =>
Expand Down Expand Up @@ -205,7 +208,7 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) {
layoutBlockSupport={ layoutBlockSupport }
/>
) }
{ constrainedType && !! contentSize && (
{ constrainedType && displayControlsForLegacyLayouts && (
<constrainedType.inspectorControls
layout={ usedLayout }
onChange={ onChangeLayout }
Expand Down

0 comments on commit 5b48607

Please sign in to comment.