From b5f7e260f3a837655fcb13b4d4cdbcc22a880894 Mon Sep 17 00:00:00 2001 From: yogeshbhutkar Date: Mon, 13 Jan 2025 16:20:44 +0530 Subject: [PATCH] Block Tools: Prevent showing empty block inserter in zoom out mode --- .../src/components/block-tools/use-show-block-tools.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/block-editor/src/components/block-tools/use-show-block-tools.js b/packages/block-editor/src/components/block-tools/use-show-block-tools.js index db651bce00fec7..aa90143ae9c04f 100644 --- a/packages/block-editor/src/components/block-tools/use-show-block-tools.js +++ b/packages/block-editor/src/components/block-tools/use-show-block-tools.js @@ -24,6 +24,7 @@ export function useShowBlockTools() { getBlockMode, getSettings, __unstableGetEditorMode, + isZoomOut, isTyping, } = unlock( select( blockEditorStore ) ); @@ -37,12 +38,14 @@ export function useShowBlockTools() { hasSelectedBlock && isUnmodifiedDefaultBlock( block ) && getBlockMode( clientId ) !== 'html'; + const isZoomOutMode = isZoomOut(); const _showEmptyBlockSideInserter = clientId && ! isTyping() && // Hide the block inserter on the navigation mode. // See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483. editorMode !== 'navigation' && + ! isZoomOutMode && isEmptyDefaultBlock; const _showBlockToolbarPopover = ! getSettings().hasFixedToolbar &&