From cf49273c8bbe60b58d05b07a39c7bc217dea12e9 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 31 Jan 2023 10:10:26 +1100 Subject: [PATCH] Add layout child sizing to Navigation block --- packages/block-editor/src/hooks/child-layout.js | 6 +++++- packages/block-library/src/navigation/block.json | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/hooks/child-layout.js b/packages/block-editor/src/hooks/child-layout.js index b530411c884ffb..bf216f32995548 100644 --- a/packages/block-editor/src/hooks/child-layout.js +++ b/packages/block-editor/src/hooks/child-layout.js @@ -135,9 +135,13 @@ export function hasChildLayoutSupport( { } ) { const { type: parentLayoutType = 'default', + default: { type: defaultParentLayoutType = 'default' } = {}, allowSizingOnChildren = false, } = parentLayout; - const support = parentLayoutType === 'flex' && allowSizingOnChildren; + + const support = + ( defaultParentLayoutType === 'flex' || parentLayoutType === 'flex' ) && + allowSizingOnChildren; return support; } diff --git a/packages/block-library/src/navigation/block.json b/packages/block-library/src/navigation/block.json index b54da128bd86e4..ee673816201492 100644 --- a/packages/block-library/src/navigation/block.json +++ b/packages/block-library/src/navigation/block.json @@ -119,6 +119,7 @@ "allowSwitching": false, "allowInheriting": false, "allowVerticalAlignment": false, + "allowSizingOnChildren": true, "default": { "type": "flex" }