Skip to content

Commit

Permalink
Only select block if there isn't any already
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed May 27, 2023
1 parent 9431f32 commit 9354a81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/block-editor/src/components/list-view/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ function ListViewBlock( {

const updateSelection = useCallback(
( newClientId ) => {
selectBlock( undefined, newClientId, null, null );
const selectedBlockClientIds = getSelectedBlockClientIds();
// Select the block to be focused if there isn't any block selected.
if ( ! selectedBlockClientIds.length ) {
selectBlock( undefined, newClientId, null, null );
}

const getFocusElement = () => {
const row = treeGridElementRef.current?.querySelector(
Expand Down

0 comments on commit 9354a81

Please sign in to comment.