Skip to content

Commit

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

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

if ( ! ref.current ) {
return;
}
Expand All @@ -54,7 +58,7 @@ export function useFocusFirstElement( { clientId, initialPosition } ) {
return;
}

if ( initialPosition === undefined || initialPosition === null ) {
if ( initialPosition === true ) {
ref.current.focus();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default function useInput() {

if ( nextClientId ) {
event.preventDefault();
selectBlock( nextClientId, null );
selectBlock( nextClientId, true );
}
}
}
Expand Down

0 comments on commit 5e9373f

Please sign in to comment.