From 25cd146dbd511dd4d33fc27de3225017b03626c5 Mon Sep 17 00:00:00 2001 From: Jorge Date: Thu, 19 Mar 2020 17:36:57 +0000 Subject: [PATCH] Fix: Focus bug on text control inside the block settings sidebar (WP 5.4 RC2) --- .../src/components/block-list/use-multi-selection.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/block-editor/src/components/block-list/use-multi-selection.js b/packages/block-editor/src/components/block-list/use-multi-selection.js index 1e77f8711a51d..8505ce7a07556 100644 --- a/packages/block-editor/src/components/block-list/use-multi-selection.js +++ b/packages/block-editor/src/components/block-list/use-multi-selection.js @@ -242,6 +242,17 @@ export default function useMultiSelection( ref ) { startClientId.current = clientId; anchorElement.current = document.activeElement; + if ( anchorElement.current ) { + const blockInspector = document.querySelector( + '.block-editor-block-inspector' + ); + if ( + blockInspector && + blockInspector.contains( anchorElement.current ) + ) { + return; + } + } startMultiSelect(); // `onSelectionStart` is called after `mousedown` and `mouseleave`