Skip to content

Commit

Permalink
Fix: Select block after duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
delowardev committed Feb 12, 2022
1 parent 9482dfa commit 48d1dce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/block-editor/src/components/list-view/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@ function ListViewBlock( {
}, [ clientId, setIsHovered, highlightBlock ] );

const selectEditorBlock = useCallback(
( event ) => {
event.stopPropagation();
selectBlock( clientId );
},
[ clientId, selectBlock ]
( _clientId ) => selectBlock( _clientId ),
[ selectBlock ]
);

const toggleExpanded = useCallback(
Expand Down Expand Up @@ -176,7 +173,10 @@ function ListViewBlock( {
<div className="block-editor-list-view-block__contents-container">
<ListViewBlockContents
block={ block }
onClick={ selectEditorBlock }
onClick={ ( event ) => {
event.stopPropagation();
selectEditorBlock( clientId );
} }
onToggleExpanded={ toggleExpanded }
isSelected={ isSelected }
position={ position }
Expand Down

0 comments on commit 48d1dce

Please sign in to comment.