Skip to content

Commit

Permalink
Allow replace operation on empty default block in Zoom Out (WordPress…
Browse files Browse the repository at this point in the history
…#68026)

* Allow replace operation on empty default block in Zoom Out

* Remove operation type from conditional check

Co-authored-by: getdave <get_dave@git.wordpress.org>
Co-authored-by: draganescu <andraganescu@git.wordpress.org>
  • Loading branch information
3 people authored Dec 16, 2024
1 parent bce0a50 commit 37da337
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,14 @@ export default function useBlockDropZone( {
const [ targetIndex, operation, nearestSide ] =
dropTargetPosition;

if ( isZoomOut() && operation !== 'insert' ) {
const isTargetIndexEmptyDefaultBlock =
blocksData[ targetIndex ]?.isUnmodifiedDefaultBlock;

if (
isZoomOut() &&
! isTargetIndexEmptyDefaultBlock &&
operation !== 'insert'
) {
return;
}

Expand Down

0 comments on commit 37da337

Please sign in to comment.