Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only select block if there isn't any already
  • Loading branch information
kevin940726 committed May 27, 2023
commit 9354a81fcc72a5785f7aebb0e593d6e21a4c86a5
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