diff --git a/packages/block-editor/src/components/inner-blocks/index.js b/packages/block-editor/src/components/inner-blocks/index.js index 2933150f31d9d..957e9fa60a3f4 100644 --- a/packages/block-editor/src/components/inner-blocks/index.js +++ b/packages/block-editor/src/components/inner-blocks/index.js @@ -150,6 +150,7 @@ const ForwardedInnerBlocks = forwardRef( ( props, ref ) => { * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md */ export function useInnerBlocksProps( props = {}, options = {} ) { + const { __experimentalLayout } = options; const { clientId, __unstableLayoutClassNames: layoutClassNames = '' } = useBlockEditContext(); const isSmallScreen = useViewportMatch( 'medium', '<' ); @@ -207,10 +208,10 @@ export function useInnerBlocksProps( props = {}, options = {} ) { ref, className: classnames( props.className, - layoutClassNames, 'block-editor-block-list__layout', { 'has-overlay': hasOverlay, + [ layoutClassNames ]: __experimentalLayout, } ), children: clientId ? ( diff --git a/packages/block-library/src/group/edit.js b/packages/block-library/src/group/edit.js index 9d43c4339ba1f..f4b69bcbf68fe 100644 --- a/packages/block-library/src/group/edit.js +++ b/packages/block-library/src/group/edit.js @@ -35,7 +35,12 @@ const htmlElementMessages = { ), }; -function GroupEdit( { attributes, setAttributes, clientId } ) { +function GroupEdit( { + attributes, + setAttributes, + clientId, + __unstableLayoutClassNames: layoutClassNames, +} ) { const { hasInnerBlocks, themeSupportsLayout } = useSelect( ( select ) => { const { getBlock, getSettings } = select( blockEditorStore ); @@ -55,7 +60,9 @@ function GroupEdit( { attributes, setAttributes, clientId } ) { const { type = 'default' } = usedLayout; const layoutSupportEnabled = themeSupportsLayout || type === 'flex'; - const blockProps = useBlockProps(); + const blockProps = useBlockProps( { + className: ! layoutSupportEnabled ? layoutClassNames : null, + } ); const innerBlocksProps = useInnerBlocksProps( layoutSupportEnabled