diff --git a/packages/block-editor/src/components/block-list/use-block-props/use-focus-first-element.js b/packages/block-editor/src/components/block-list/use-block-props/use-focus-first-element.js index 26f7cca2990d8..40262c99e19dd 100644 --- a/packages/block-editor/src/components/block-list/use-block-props/use-focus-first-element.js +++ b/packages/block-editor/src/components/block-list/use-block-props/use-focus-first-element.js @@ -43,10 +43,6 @@ export function useFocusFirstElement( { clientId, initialPosition } ) { return; } - if ( initialPosition === undefined || initialPosition === null ) { - return; - } - if ( ! ref.current ) { return; } @@ -58,6 +54,11 @@ export function useFocusFirstElement( { clientId, initialPosition } ) { return; } + if ( initialPosition === undefined || initialPosition === null ) { + ref.current.focus(); + return; + } + // Find all tabbables within node. const textInputs = focus.tabbable .find( ref.current ) diff --git a/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js b/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js index bcf05eadc0daf..be666dc12d34a 100644 --- a/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +++ b/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js @@ -116,7 +116,7 @@ export function useEventHandlers( { clientId, isSelected } ) { } if ( nextClientId ) { - selectBlock( nextClientId ); + selectBlock( nextClientId, null ); } } } else {