diff --git a/packages/block-editor/src/components/block-list/block-selection-button.js b/packages/block-editor/src/components/block-list/block-selection-button.js index 224e6f6b3ca8aa..25147af72e5501 100644 --- a/packages/block-editor/src/components/block-list/block-selection-button.js +++ b/packages/block-editor/src/components/block-list/block-selection-button.js @@ -47,11 +47,12 @@ function BlockSelectionButton( { const { name, attributes } = __unstableGetBlockWithoutInnerBlocks( clientId ); - return { index, name, attributes, isBlockMovingMode }; + const blockMovingMode = isBlockMovingMode(); + return { index, name, attributes, blockMovingMode }; }, [ clientId, rootClientId ] ); - const { index, name, attributes, isBlockMovingMode } = selected; + const { index, name, attributes, blockMovingMode } = selected; const { setNavigationMode, removeBlock } = useDispatch( 'core/block-editor' ); @@ -82,7 +83,7 @@ function BlockSelectionButton( { const classNames = classnames( 'block-editor-block-list__block-selection-button', { - 'is-navigate-mode': !! isBlockMovingMode(), + 'is-block-moving-mode': !! blockMovingMode, } ); diff --git a/packages/block-editor/src/components/block-list/style.scss b/packages/block-editor/src/components/block-list/style.scss index 97241d5fbd5246..df02f73712c791 100644 --- a/packages/block-editor/src/components/block-list/style.scss +++ b/packages/block-editor/src/components/block-list/style.scss @@ -208,9 +208,12 @@ } -.is-navigate-mode.block-editor-block-list__breadcrumb { +.is-block-moving-mode.block-editor-block-list__breadcrumb { // Should be invisible but not unfocusable. opacity: 0; + font-size: 1px; + height: 1px; + padding: 0; } /** diff --git a/packages/block-editor/src/components/writing-flow/index.js b/packages/block-editor/src/components/writing-flow/index.js index e4473b6f3bbfdf..205c7a0fa3efbc 100644 --- a/packages/block-editor/src/components/writing-flow/index.js +++ b/packages/block-editor/src/components/writing-flow/index.js @@ -451,7 +451,10 @@ export default function WritingFlow( { children } ) { ) ); } - + if ( isEscape && startingBlockClientId ) { + setBlockMovingMode( null ); + setCanInsertMovingBlock( false ); + } if ( ( isEnter || isSpace ) && startingBlockClientId ) { const sourceRoot = getBlockRootClientId( startingBlockClientId