Skip to content

Commit

Permalink
Add layout child sizing to Navigation block (#47584)
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines authored Jan 31, 2023
1 parent bb9b5c2 commit 793cd39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/block-editor/src/hooks/child-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"allowSwitching": false,
"allowInheriting": false,
"allowVerticalAlignment": false,
"allowSizingOnChildren": true,
"default": {
"type": "flex"
}
Expand Down

1 comment on commit 793cd39

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 793cd39.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4059173158
📝 Reported issues:

Please sign in to comment.