Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always pass layout to inner blocks #47477

Merged
merged 7 commits into from
Jan 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/block-editor/src/components/inner-blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,15 @@ function UncontrolledInnerBlocks( props ) {
[ clientId ]
);

// Avoid creating new objects if there is no layout defined.
const emptyLayout = {};

Mamaduka marked this conversation as resolved.
Show resolved Hide resolved
const defaultLayoutBlockSupport =
getBlockSupport( name, '__experimentalLayout' ) || {};
getBlockSupport( name, '__experimentalLayout' ) || emptyLayout;

const { allowSizingOnChildren = false } = defaultLayoutBlockSupport;

const defaultLayout = useSetting( 'layout' ) || {};
const defaultLayout = useSetting( 'layout' ) || emptyLayout;

const usedLayout = layout || defaultLayoutBlockSupport;

Expand Down