Skip to content

Commit

Permalink
focus block selection button only in navigation mode (WordPress#60207)
Browse files Browse the repository at this point in the history
  • Loading branch information
draganescu authored and carstingaxion committed Mar 27, 2024
1 parent b64bc38 commit 88a8be3
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -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 {
Expand Down

0 comments on commit 88a8be3

Please sign in to comment.