Skip to content

Commit

Permalink
Prevent block overlay on blocks with a 'contentOnly' editing mode (Wo…
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks authored and sethrubenstein committed Jul 13, 2023
1 parent feb46c3 commit e7864e5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2837,10 +2837,11 @@ export function __unstableGetTemporarilyEditingAsBlocks( state ) {
}

export function __unstableHasActiveBlockOverlayActive( state, clientId ) {
// Prevent overlay on disabled blocks. It's redundant since disabled blocks
// can't be selected, and prevents non-disabled nested blocks from being
// selected.
if ( getBlockEditingMode( state, clientId ) === 'disabled' ) {
// Prevent overlay on blocks with a non-default editing mode. If the mdoe 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' ) {
return false;
}

Expand Down

0 comments on commit e7864e5

Please sign in to comment.