From f1d13f3f5f0dc484b8d013d49aa9b91c32277801 Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Fri, 18 Oct 2019 12:11:34 +0800 Subject: [PATCH] Enable movers only in nav block block navigator --- .../block-editor/src/components/block-navigation/list.js | 6 +++++- .../src/navigation-menu/use-block-navigator.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/block-navigation/list.js b/packages/block-editor/src/components/block-navigation/list.js index 9684de7c3e724e..45ed4fd0596c7d 100644 --- a/packages/block-editor/src/components/block-navigation/list.js +++ b/packages/block-editor/src/components/block-navigation/list.js @@ -45,7 +45,10 @@ export default function BlockNavigationList( { selectedBlockClientId, selectBlock, showNestedBlocks, + showMovers, } ) { + const hasMovers = showMovers && blocks.length > 1; + return ( /* * Disable reason: The `list` ARIA role is redundant but @@ -70,7 +73,7 @@ export default function BlockNavigationList( { { getBlockDisplayName( blockType, block.attributes ) } { isSelected && { __( '(selected block)' ) } } - { blocks.length > 1 && ( ) } + { hasMovers && ( ) } { showNestedBlocks && !! block.innerBlocks && !! block.innerBlocks.length && ( ) } diff --git a/packages/block-library/src/navigation-menu/use-block-navigator.js b/packages/block-library/src/navigation-menu/use-block-navigator.js index dd924d3eb5f8b3..227c1f7e6b92b9 100644 --- a/packages/block-library/src/navigation-menu/use-block-navigator.js +++ b/packages/block-library/src/navigation-menu/use-block-navigator.js @@ -69,6 +69,7 @@ export default function useBlockNavigator( clientId ) { selectedBlockClientId={ selectedBlockClientId } selectBlock={ selectBlock } showNestedBlocks + showMovers /> );