Skip to content

Commit

Permalink
Make sections contentOnly in Zoom Out (#65396)
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave authored Sep 19, 2024
1 parent 74707b6 commit 2205e9e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/block-editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2926,6 +2926,7 @@ export const getBlockEditingMode = createRegistrySelector(
if ( clientId === null ) {
clientId = '';
}

// In zoom-out mode, override the behavior set by
// __unstableSetBlockEditingMode to only allow editing the top-level
// sections.
Expand All @@ -2943,9 +2944,13 @@ export const getBlockEditingMode = createRegistrySelector(
state,
sectionRootClientId
);
if ( ! sectionsClientIds?.includes( clientId ) ) {
return 'disabled';

// Sections are always contentOnly.
if ( sectionsClientIds?.includes( clientId ) ) {
return 'contentOnly';
}

return 'disabled';
}

const blockEditingMode = state.blockEditingModes.get( clientId );
Expand Down

0 comments on commit 2205e9e

Please sign in to comment.