From 2205e9e9f8aae8a2cfd542f7d57296e651dc12cb Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Thu, 19 Sep 2024 13:39:43 +0100 Subject: [PATCH] Make sections contentOnly in Zoom Out (#65396) --- packages/block-editor/src/store/selectors.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index 30fdb76bdbe787..5780b2afe2a672 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -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. @@ -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 );