From 88a8be3544d0983da5c31d7fd9fa6dfc579aa4a1 Mon Sep 17 00:00:00 2001 From: Andrei Draganescu Date: Wed, 27 Mar 2024 12:52:37 +0200 Subject: [PATCH] focus block selection button only in navigation mode (#60207) --- .../src/components/block-tools/block-selection-button.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/block-tools/block-selection-button.js b/packages/block-editor/src/components/block-tools/block-selection-button.js index e8fad9a62a5f1..47a7001d2ef69 100644 --- a/packages/block-editor/src/components/block-tools/block-selection-button.js +++ b/packages/block-editor/src/components/block-tools/block-selection-button.js @@ -123,10 +123,11 @@ function BlockSelectionButton( { clientId, rootClientId } ) { // Focus the breadcrumb in navigation mode. useEffect( () => { - ref.current.focus(); - - speak( label ); - }, [ label ] ); + if ( editorMode === 'navigation' ) { + ref.current.focus(); + speak( label ); + } + }, [ label, editorMode ] ); const blockElement = useBlockElement( clientId ); const {