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 18, 2024
1 parent df3423b commit 211052c
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 211052c

Please sign in to comment.