From c808e0bc1db60a430f7a624a3a95312484bd5fba Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 30 Aug 2022 09:33:14 +1000 Subject: [PATCH] Fix display of width controls for legacy layouts --- packages/block-editor/src/hooks/layout.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/hooks/layout.js b/packages/block-editor/src/hooks/layout.js index c4d4af0b95d4c3..919c3275c1d772 100644 --- a/packages/block-editor/src/hooks/layout.js +++ b/packages/block-editor/src/hooks/layout.js @@ -141,6 +141,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 ) => @@ -200,7 +203,7 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) { layoutBlockSupport={ layoutBlockSupport } /> ) } - { constrainedType && !! contentSize && ( + { constrainedType && displayControlsForLegacyLayouts && (