Skip to content

Commit

Permalink
Hack in ability to move blocks in contentOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 3, 2024
1 parent 730a31e commit 98adc4b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/block-editor/src/components/block-toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ export function PrivateBlockToolbar( {
disabled={ ! isDefaultEditingMode }
isUsingBindings={ isUsingBindings }
/>
{ isDefaultEditingMode && (
<>
{ ! isMultiToolbar && (
<BlockLockToolbar
clientId={ blockClientId }
/>
) }
<BlockMover
clientIds={ blockClientIds }
hideDragHandle={ hideDragHandle }
/>
</>
{ isDefaultEditingMode && ! isMultiToolbar && (
<BlockLockToolbar
clientId={ blockClientId }
/>
) }

{ ( isDefaultEditingMode ||
isContentOnlyEditingMode ) && (
<BlockMover
clientIds={ blockClientIds }
hideDragHandle={ hideDragHandle }
/>
) }
</ToolbarGroup>
</div>
Expand Down
5 changes: 5 additions & 0 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1767,6 +1767,11 @@ export function canMoveBlock( state, clientId ) {
if ( getTemplateLock( state, rootClientId ) === 'all' ) {
return false;
}

if ( getBlockEditingMode( state, clientId ) === 'contentOnly' ) {
return true;
}

return getBlockEditingMode( state, rootClientId ) !== 'disabled';
}

Expand Down

0 comments on commit 98adc4b

Please sign in to comment.