Skip to content

Commit

Permalink
don't put overlay on all blocks in zoom out, just root and section ch…
Browse files Browse the repository at this point in the history
…ildren
  • Loading branch information
draganescu committed Apr 11, 2024
1 parent fd8cf0a commit b96f5a6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2816,11 +2816,17 @@ export function __unstableHasActiveBlockOverlayActive( state, clientId ) {
// In zoom-out mode, the block overlay is always active for section level blocks.
if ( editorMode === 'zoom-out' ) {
const { sectionRootClientId } = unlock( getSettings( state ) );
const sectionClientIds = getBlockOrder( state, sectionRootClientId );
if ( sectionClientIds?.includes( clientId ) ) {
if ( sectionRootClientId ) {
const sectionClientIds = getBlockOrder(
state,
sectionRootClientId
);
if ( sectionClientIds?.includes( clientId ) ) {
return true;
}
} else if ( clientId && ! getBlockRootClientId( state, clientId ) ) {
return true;
}
return true;
}

// In navigation mode, the block overlay is active when the block is not
Expand Down

0 comments on commit b96f5a6

Please sign in to comment.