From f0aee7b5eda06332a1089befc4d3bbdc7f90c526 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 8 Aug 2024 20:30:54 +0400 Subject: [PATCH] Block Editor: Don't hide the toolbar for an empty default block in HTML mode (#64374) Unlinked contributors: designsimply. Co-authored-by: Mamaduka Co-authored-by: stokesman Co-authored-by: Thelmachido Co-authored-by: mboynes --- .../src/components/block-tools/use-show-block-tools.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/block-tools/use-show-block-tools.js b/packages/block-editor/src/components/block-tools/use-show-block-tools.js index 33807445b8da74..07e0ebd16a64b0 100644 --- a/packages/block-editor/src/components/block-tools/use-show-block-tools.js +++ b/packages/block-editor/src/components/block-tools/use-show-block-tools.js @@ -20,6 +20,7 @@ export function useShowBlockTools() { getSelectedBlockClientId, getFirstMultiSelectedBlockClientId, getBlock, + getBlockMode, getSettings, hasMultiSelection, __unstableGetEditorMode, @@ -33,7 +34,9 @@ export function useShowBlockTools() { const editorMode = __unstableGetEditorMode(); const hasSelectedBlock = !! clientId && !! block; const isEmptyDefaultBlock = - hasSelectedBlock && isUnmodifiedDefaultBlock( block ); + hasSelectedBlock && + isUnmodifiedDefaultBlock( block ) && + getBlockMode( clientId ) !== 'html'; const _showEmptyBlockSideInserter = clientId && ! isTyping() &&