From f5eaa4f97365d0cb385a1516b125149c839c6aeb Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Wed, 12 Oct 2022 10:31:59 +0100 Subject: [PATCH] Fix: Inspector is usable on the top level block even if it is content locked (#44878) --- .../block-editor/src/components/block-inspector/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/block-editor/src/components/block-inspector/index.js b/packages/block-editor/src/components/block-inspector/index.js index 5d51218756e22d..379d8806f2a68c 100644 --- a/packages/block-editor/src/components/block-inspector/index.js +++ b/packages/block-editor/src/components/block-inspector/index.js @@ -144,6 +144,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { getSelectedBlockCount, getBlockName, __unstableGetContentLockingParent, + getTemplateLock, } = select( blockEditorStore ); const _selectedBlockClientId = getSelectedBlockClientId(); @@ -157,9 +158,11 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => { selectedBlockClientId: _selectedBlockClientId, selectedBlockName: _selectedBlockName, blockType: _blockType, - topLevelLockedBlock: __unstableGetContentLockingParent( - _selectedBlockClientId - ), + topLevelLockedBlock: + __unstableGetContentLockingParent( _selectedBlockClientId ) || + ( getTemplateLock( _selectedBlockClientId ) === 'contentOnly' + ? _selectedBlockClientId + : undefined ), }; }, [] );