Skip to content

Commit

Permalink
Pattern Inserter: Fix unintended preview panel display when hovering …
Browse files Browse the repository at this point in the history
…mouse over pattern (#47693)
  • Loading branch information
t-hamano authored and Mamaduka committed Feb 3, 2023
1 parent 98bef41 commit 5b498c5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ function InserterMenu(
[ onToggleInsertionPoint, setHoveredItem ]
);

const onHoverPattern = useCallback(
( item ) => {
onToggleInsertionPoint( !! item );
},
[ onToggleInsertionPoint ]
);

const onClickPatternCategory = useCallback(
( patternCategory ) => {
setSelectedPatternCategory( patternCategory );
Expand Down Expand Up @@ -296,7 +303,7 @@ function InserterMenu(
<BlockPatternsCategoryDialog
rootClientId={ destinationRootClientId }
onInsert={ onInsertPattern }
onHover={ onHover }
onHover={ onHoverPattern }
category={ selectedPatternCategory }
showTitlesAsTooltip
/>
Expand Down

0 comments on commit 5b498c5

Please sign in to comment.