diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index 35eadad3cc99b1..89bbb641cdbabe 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -2986,11 +2986,21 @@ export const __unstableGetVisibleBlocks = createSelector( ); export function __unstableHasActiveBlockOverlayActive( state, clientId ) { + const blockName = getBlockName( state, clientId ); + const editingMode = getBlockEditingMode( state, clientId ); + + // Temporary: Allow Navigation block to have overlay in contentOnly mode + // to promote the off-canvas editing experience. + // See: https://github.com/WordPress/gutenberg/issues/71757 + // TODO: Replace with block support mechanism in future iteration. + const isNavigationInContentOnly = + blockName === 'core/navigation' && editingMode === 'contentOnly'; + // Prevent overlay on blocks with a non-default editing mode. If the mode is // 'disabled' then the overlay is redundant since the block can't be // selected. If the mode is 'contentOnly' then the overlay is redundant // since there will be no controls to interact with once selected. - if ( getBlockEditingMode( state, clientId ) !== 'default' ) { + if ( editingMode !== 'default' && ! isNavigationInContentOnly ) { return false; }