Skip to content

Commit

Permalink
don't allow shuffle for locked patterns (#60381)
Browse files Browse the repository at this point in the history
Co-authored-by: draganescu <[email protected]>
Co-authored-by: richtabor <[email protected]>
  • Loading branch information
3 people authored Apr 3, 2024
1 parent 570be6f commit 910f598
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
getNextBlockClientId,
getPreviousBlockClientId,
canRemoveBlock,
canMoveBlock,
} = select( blockEditorStore );
const { getActiveBlockVariation, getBlockType } =
select( blocksStore );
Expand Down Expand Up @@ -107,6 +108,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
isNextBlockTemplatePart,
isPrevBlockTemplatePart,
canRemove: canRemoveBlock( clientId, rootClientId ),
canMove: canMoveBlock( clientId, rootClientId ),
};
},
[ clientId, rootClientId ]
Expand All @@ -120,6 +122,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
isNextBlockTemplatePart,
isPrevBlockTemplatePart,
canRemove,
canMove,
} = selected;
const { setNavigationMode, removeBlock } = useDispatch( blockEditorStore );
const ref = useRef();
Expand Down Expand Up @@ -318,7 +321,7 @@ function BlockSelectionButton( { clientId, rootClientId } ) {
</BlockDraggable>
) }
</FlexItem>
{ editorMode === 'zoom-out' && (
{ canMove && canRemove && editorMode === 'zoom-out' && (
<Shuffle clientId={ clientId } as={ Button } />
) }
{ canRemove &&
Expand Down

0 comments on commit 910f598

Please sign in to comment.