From e3532dbf9603646f88cdfd7b12181c2bbad784a3 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Wed, 2 Nov 2022 15:54:00 +1100 Subject: [PATCH] Don't trash existing styles --- packages/block-editor/src/hooks/layout.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/hooks/layout.js b/packages/block-editor/src/hooks/layout.js index 349b716f258896..05712ca95a8741 100644 --- a/packages/block-editor/src/hooks/layout.js +++ b/packages/block-editor/src/hooks/layout.js @@ -269,7 +269,8 @@ function LayoutPanel( { setAttributes, attributes, name: blockName } ) { } function ChildLayoutPanel( { setAttributes, attributes } ) { - const { style: { layout = {} } = {} } = attributes; + const { style = {} } = attributes; + const { layout = {} } = style; const { selfStretch, flexSize } = layout; return ( @@ -311,6 +312,7 @@ function ChildLayoutPanel( { setAttributes, attributes } ) { onChange={ ( value ) => { setAttributes( { style: { + ...style, layout: { ...layout, flexSize: value,