From 56bd95a5c9a049dfadeb9f6ce7b65774eb2a5bda 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 4fc7acd0fed4d..190f169773daa 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 : {} ),