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
  • Loading branch information
t-hamano committed Feb 2, 2023
1 parent f3905b2 commit 4f45b41
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 4f45b41

Please sign in to comment.