Skip to content

Commit

Permalink
Block Tools: Prevent showing empty block inserter in zoom out mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Jan 13, 2025
1 parent 88b4e1d commit b5f7e26
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function useShowBlockTools() {
getBlockMode,
getSettings,
__unstableGetEditorMode,
isZoomOut,
isTyping,
} = unlock( select( blockEditorStore ) );

Expand All @@ -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 &&
Expand Down

0 comments on commit b5f7e26

Please sign in to comment.