Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading