Skip to content

Commit

Permalink
Drag and drop: Allow dropping within template parts
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Jan 30, 2024
1 parent 8895a51 commit d7bd92f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
5 changes: 4 additions & 1 deletion packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ function BlockListBlockProvider( props ) {
__unstableIsFullySelected,
__unstableSelectionHasUnmergeableBlock,
isBlockBeingDragged,
isDraggingBlocks,
hasBlockMovingClientId,
canInsertBlockType,
getBlockRootClientId,
Expand Down Expand Up @@ -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()
Expand Down
11 changes: 4 additions & 7 deletions packages/block-editor/src/components/inner-blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 !== 'default',
defaultLayout,
};
},
Expand Down

0 comments on commit d7bd92f

Please sign in to comment.