Skip to content

Commit

Permalink
Legacy Group inner block wrapper should work with constrained layout. (
Browse files Browse the repository at this point in the history
…#44660)

* Legacy Group inner block wrapper should work with constrained layout.

* Also restore wrapper on the front end.

* Allow Group blocks with inner wrapper to show placeholder

* More specific CSS selectors.
  • Loading branch information
tellthemachines authored and ockham committed Oct 10, 2022
1 parent e2f4b7e commit 8c0c1a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ function gutenberg_restore_group_inner_container( $block_content, $block ) {
if (
WP_Theme_JSON_Resolver_Gutenberg::theme_has_support() ||
1 === preg_match( $group_with_inner_container_regex, $block_content ) ||
( isset( $block['attrs']['layout']['type'] ) && 'default' !== $block['attrs']['layout']['type'] )
( isset( $block['attrs']['layout']['type'] ) && 'flex' === $block['attrs']['layout']['type'] )
) {
return $block_content;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
// When the appender shows up in empty container blocks, such as Group and Columns, add an extra click state.
.block-list-appender:only-child {
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > &,
.is-layout-flow.block-editor-block-list__block:not(.is-selected) > & {
.is-layout-flow.block-editor-block-list__block:not(.is-selected) > &,
.is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > &,
.is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > & {
pointer-events: none;

&::after {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/group/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function GroupEdit( { attributes, setAttributes, clientId } ) {
? { ...defaultLayout, ...layout, type: 'default' }
: { ...defaultLayout, ...layout };
const { type = 'default' } = usedLayout;
const layoutSupportEnabled = themeSupportsLayout || type !== 'default';
const layoutSupportEnabled = themeSupportsLayout || type === 'flex';

const blockProps = useBlockProps();

Expand Down

0 comments on commit 8c0c1a5

Please sign in to comment.