From 04759220d948643b1b3f1b70eeb38d6b02354251 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 18 Sep 2024 13:34:21 +0100 Subject: [PATCH] Allow inserting blocks within the sections root container in navigation mode --- packages/block-editor/src/store/selectors.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/store/selectors.js b/packages/block-editor/src/store/selectors.js index d6afb313400a8c..1c3bf28ab082d7 100644 --- a/packages/block-editor/src/store/selectors.js +++ b/packages/block-editor/src/store/selectors.js @@ -2964,13 +2964,19 @@ export const getBlockEditingMode = createRegistrySelector( if ( ! clientId ) { return 'default'; } - const rootClientId = getBlockRootClientId( state, clientId ); - const templateLock = getTemplateLock( state, rootClientId ); const sectionRootClientId = getSectionRootClientId( state ); + if ( + editorMode === 'navigation' && + clientId === sectionRootClientId + ) { + return 'default'; + } const sectionsClientIds = getBlockOrder( state, sectionRootClientId ); + const rootClientId = getBlockRootClientId( state, clientId ); + const templateLock = getTemplateLock( state, rootClientId ); if ( templateLock === 'contentOnly' || editorMode === 'navigation'