From d179303b68f47c9ed68fb5c5af5a63df743ebb79 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 4 Sep 2024 11:30:42 +0400 Subject: [PATCH] Pattern: Don't render block controls when an entity is missing (#65028) * Pattern: Don't render block controls when an entity is missing * Reference correct 'ButtonBlockAppender' Co-authored-by: Mamaduka --- packages/block-library/src/block/edit.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/block/edit.js b/packages/block-library/src/block/edit.js index 53422e1c4cb8c0..3dd5faf67b31f6 100644 --- a/packages/block-library/src/block/edit.js +++ b/packages/block-library/src/block/edit.js @@ -29,6 +29,7 @@ import { privateApis as blockEditorPrivateApis, store as blockEditorStore, BlockControls, + InnerBlocks, } from '@wordpress/block-editor'; import { privateApis as patternsPrivateApis } from '@wordpress/patterns'; import { store as blocksStore } from '@wordpress/blocks'; @@ -254,7 +255,9 @@ function ReusableBlockEdit( { value: innerBlocks.length > 0 ? innerBlocks : blocks, onInput: NOOP, onChange: NOOP, - renderAppender: blocks?.length ? undefined : blocks.ButtonBlockAppender, + renderAppender: blocks?.length + ? undefined + : InnerBlocks.ButtonBlockAppender, } ); const handleEditOriginal = () => { @@ -292,7 +295,7 @@ function ReusableBlockEdit( { return ( <> - { hasResolved && ( + { hasResolved && ! isMissing && (