From d44bd993f71269e40985509eeb6c6c618d9e021f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Fri, 18 Feb 2022 21:32:07 +0200 Subject: [PATCH] Fix ctrl+A --- .../src/components/writing-flow/use-multi-selection.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/writing-flow/use-multi-selection.js b/packages/block-editor/src/components/writing-flow/use-multi-selection.js index 691aa5e6b4488d..0ba26e15baac63 100644 --- a/packages/block-editor/src/components/writing-flow/use-multi-selection.js +++ b/packages/block-editor/src/components/writing-flow/use-multi-selection.js @@ -136,9 +136,15 @@ export default function useMultiSelection() { return; } + const { anchorNode, focusNode } = defaultView.getSelection(); + if ( isSimpleContentEditable( startRef.current ) && - isSimpleContentEditable( endRef.current ) + ( startRef.current.contains( anchorNode ) || + startRef.current.contains( focusNode ) ) && + isSimpleContentEditable( endRef.current ) && + ( endRef.current.contains( anchorNode ) || + endRef.current.contains( focusNode ) ) ) { return; }