From ecb72b476a15bac8158cb0558fb684f2345c0597 Mon Sep 17 00:00:00 2001 From: dinoliu Date: Wed, 21 Dec 2022 10:31:01 +0800 Subject: [PATCH] fix(outline): auto focus unexpectedly after re-render --- src/ts/outline/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/outline/index.ts b/src/ts/outline/index.ts index a193b3e14..9fa522cc0 100644 --- a/src/ts/outline/index.ts +++ b/src/ts/outline/index.ts @@ -38,7 +38,7 @@ export class Outline { const range = getSelection().getRangeAt(0); if (vditor[vditor.currentMode].element.contains(range.startContainer)) { setSelectionFocus(range); - } else { + } else if (vditor[vditor.currentMode].element.contains(getSelection().focusNode)) { vditor[vditor.currentMode].element.focus(); } }