Skip to content

Commit

Permalink
Fix: Inspector is usable on the top level block even if it is content…
Browse files Browse the repository at this point in the history
… locked (#44878)
  • Loading branch information
jorgefilipecosta authored and michalczaplinski committed Oct 18, 2022
1 parent 346ff74 commit 6ef0ed8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/block-editor/src/components/block-inspector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
getSelectedBlockCount,
getBlockName,
__unstableGetContentLockingParent,
getTemplateLock,
} = select( blockEditorStore );

const _selectedBlockClientId = getSelectedBlockClientId();
Expand All @@ -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 ),
};
}, [] );

Expand Down

0 comments on commit 6ef0ed8

Please sign in to comment.