From 92caa88debbd0429c3d2a2a5e82a911a705a1a5d Mon Sep 17 00:00:00 2001 From: Ella van Durpe Date: Mon, 8 Jun 2020 23:03:36 +0300 Subject: [PATCH] Only add listeners in navigation mode --- .../block-editor/src/components/block-list/block-wrapper.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/block-list/block-wrapper.js b/packages/block-editor/src/components/block-list/block-wrapper.js index a607bc6e7f7c2..72f0af941fbad 100644 --- a/packages/block-editor/src/components/block-list/block-wrapper.js +++ b/packages/block-editor/src/components/block-list/block-wrapper.js @@ -252,8 +252,9 @@ const BlockComponent = forwardRef( onKeyDown={ isSelected && ! isLocked ? onKeyDown : undefined } // Only allow selection to be started from a selected block. onMouseLeave={ isSelected ? onMouseLeave : undefined } - onMouseOver={ onMouseOver } - onMouseOut={ onMouseOut } + // No need to have these listeners for hover class in edit mode. + onMouseOver={ isNavigationMode ? onMouseOver : undefined } + onMouseOut={ isNavigationMode ? onMouseOut : undefined } tabIndex="0" style={ { ...( wrapperProps ? wrapperProps.style : {} ),