Skip to content

Commit

Permalink
Select the block wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Dec 4, 2024
1 parent f2e325b commit d35ec89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export function useFocusFirstElement( { clientId, initialPosition } ) {
return;
}

if ( initialPosition === undefined || initialPosition === null ) {
return;
}

if ( ! ref.current ) {
return;
}
Expand All @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function useEventHandlers( { clientId, isSelected } ) {
}

if ( nextClientId ) {
selectBlock( nextClientId );
selectBlock( nextClientId, null );
}
}
} else {
Expand Down

0 comments on commit d35ec89

Please sign in to comment.