Skip to content

Commit

Permalink
[Block Editor]: Fix onHover errors at BlockPattern (#47466)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Jan 27, 2023
1 parent 9cac2e9 commit 94ff2ba
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function BlockPattern( {
onDragStart={ ( event ) => {
setIsDragging( true );
if ( onDragStart ) {
onHover( null );
onHover?.( null );
onDragStart( event );
}
} }
Expand All @@ -73,15 +73,15 @@ function BlockPattern( {
className="block-editor-block-patterns-list__item"
onClick={ () => {
onClick( pattern, blocks );
onHover( null );
onHover?.( null );
} }
onMouseEnter={ () => {
if ( isDragging ) {
return;
}
onHover( pattern );
onHover?.( pattern );
} }
onMouseLeave={ () => onHover( null ) }
onMouseLeave={ () => onHover?.( null ) }
aria-label={ pattern.title }
aria-describedby={
pattern.description ? descriptionId : undefined
Expand Down

0 comments on commit 94ff2ba

Please sign in to comment.