Skip to content

Commit

Permalink
Zoom Out: Don't use the drag and drop chip for patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed May 9, 2024
1 parent b0f5bb9 commit 0d5cfef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ const InserterDraggableBlocks = ( {
stopDragging();
} }
__experimentalDragComponent={
<BlockDraggableChip
count={ blocks.length }
icon={ icon || ( ! pattern && blockTypeIcon ) }
isPattern={ !! pattern }
/>
pattern ? (
false
) : (
<BlockDraggableChip
count={ blocks.length }
icon={ icon || ( ! pattern && blockTypeIcon ) }
isPattern={ !! pattern }
/>
)
}
>
{ ( { onDraggableStart, onDraggableEnd } ) => {
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/draggable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export function Draggable( {
JSON.stringify( transferData )
);

if ( dragComponent === false ) {
return;
}

const cloneWrapper = ownerDocument.createElement( 'div' );
// Reset position to 0,0. Natural stacking order will position this lower, even with a transform otherwise.
cloneWrapper.style.top = '0';
Expand Down

0 comments on commit 0d5cfef

Please sign in to comment.