From 1a77b44df8f17b6d9b3ac21e86cdbf932df7c142 Mon Sep 17 00:00:00 2001 From: Vadim Nicolai Date: Tue, 5 Feb 2019 16:56:01 +0200 Subject: [PATCH] Disable navigation block for text mode. (#12185) * Disable navigation block for text mode. * Add additional rule for disabling navigation blocks. * Disable click handler for required rules. * Adjusted click handler for for text mode. * Disabled keyboard shortcut in text mode. * Deleted obsolete onClick check. --- .../editor/src/components/block-navigation/dropdown.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/components/block-navigation/dropdown.js b/packages/editor/src/components/block-navigation/dropdown.js index c6b8e976db5cc..bfcb5f3f0e2d3 100644 --- a/packages/editor/src/components/block-navigation/dropdown.js +++ b/packages/editor/src/components/block-navigation/dropdown.js @@ -18,17 +18,18 @@ const MenuIcon = ( ); -function BlockNavigationDropdown( { hasBlocks } ) { +function BlockNavigationDropdown( { hasBlocks, isTextModeEnabled } ) { return ( ( - + } ) } @@ -50,5 +51,6 @@ function BlockNavigationDropdown( { hasBlocks } ) { export default withSelect( ( select ) => { return { hasBlocks: !! select( 'core/editor' ).getBlockCount(), + isTextModeEnabled: select( 'core/edit-post' ).getEditorMode() === 'text', }; } )( BlockNavigationDropdown );