diff --git a/packages/block-editor/src/components/block-list/block.js b/packages/block-editor/src/components/block-list/block.js index deef2d75386fd5..c44705d3fb7535 100644 --- a/packages/block-editor/src/components/block-list/block.js +++ b/packages/block-editor/src/components/block-list/block.js @@ -517,6 +517,7 @@ function BlockListBlockProvider( props ) { __unstableIsFullySelected, __unstableSelectionHasUnmergeableBlock, isBlockBeingDragged, + isDraggingBlocks, hasBlockMovingClientId, canInsertBlockType, getBlockRootClientId, @@ -594,7 +595,9 @@ function BlockListBlockProvider( props ) { blockEditingMode === 'disabled' && isBlockSubtreeDisabled( clientId ), isOutlineEnabled: outlineMode, - hasOverlay: __unstableHasActiveBlockOverlayActive( clientId ), + hasOverlay: + __unstableHasActiveBlockOverlayActive( clientId ) && + ! isDraggingBlocks(), initialPosition: _isSelected && __unstableGetEditorMode() === 'edit' ? getSelectedBlocksInitialCaretPosition() diff --git a/packages/block-editor/src/components/inner-blocks/index.js b/packages/block-editor/src/components/inner-blocks/index.js index 442f2568ce73dd..5233c063ba2094 100644 --- a/packages/block-editor/src/components/inner-blocks/index.js +++ b/packages/block-editor/src/components/inner-blocks/index.js @@ -197,10 +197,9 @@ export function useInnerBlocksProps( props = {}, options = {} ) { __unstableGetEditorMode, getTemplateLock, getBlockRootClientId, - __unstableIsWithinBlockOverlay, - __unstableHasActiveBlockOverlayActive, getBlockEditingMode, getBlockSettings, + isDraggingBlocks, } = unlock( select( blockEditorStore ) ); const { hasBlockSupport, getBlockType } = select( blocksStore ); const blockName = getBlockName( clientId ); @@ -219,15 +218,13 @@ export function useInnerBlocksProps( props = {}, options = {} ) { blockName !== 'core/template' && ! isBlockSelected( clientId ) && ! hasSelectedInnerBlock( clientId, true ) && - enableClickThrough, + enableClickThrough && + ! isDraggingBlocks(), name: blockName, blockType: getBlockType( blockName ), parentLock: getTemplateLock( parentClientId ), parentClientId, - isDropZoneDisabled: - blockEditingMode !== 'default' || - __unstableHasActiveBlockOverlayActive( clientId ) || - __unstableIsWithinBlockOverlay( clientId ), + isDropZoneDisabled: blockEditingMode === 'disabled', defaultLayout, }; }, diff --git a/packages/editor/src/components/editor-canvas/index.js b/packages/editor/src/components/editor-canvas/index.js index 3d561a5c01cda4..2a1a1d929663b5 100644 --- a/packages/editor/src/components/editor-canvas/index.js +++ b/packages/editor/src/components/editor-canvas/index.js @@ -376,6 +376,10 @@ function EditorCanvas( { : localRef.current?.parentNode } renderAppender={ renderAppender } + __unstableDisableDropZone={ + // In template preview mode, disable drop zones at the root of the template. + renderingMode === 'template-locked' ? true : false + } />