From d70f02e5b7f283924d5532bb08210af14ca1f044 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 16 Jun 2022 12:05:16 +0800 Subject: [PATCH] =?UTF-8?q?:recycle:=20=E5=88=A0=E9=99=A4=20iframe=20?= =?UTF-8?q?=E4=B8=8B=E6=96=B9=E7=9A=84=E5=9D=97=E5=86=8D=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20iframe=EF=BC=8C=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/util/selection.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts index fae715313..61d614e14 100644 --- a/app/src/protyle/util/selection.ts +++ b/app/src/protyle/util/selection.ts @@ -481,20 +481,7 @@ export const focusSideBlock = (updateElement: Element) => { if (!sideBlockElement) { sideBlockElement = updateElement; } - const cursorElement = getContenteditableElement(sideBlockElement); - if (cursorElement) { - const range = getEditorRange(cursorElement); - range.selectNodeContents(cursorElement); - range.collapse(collapse); - focusByRange(range); - } else { - const mathElement = updateElement.querySelector(".katex-display"); - if (mathElement) { - const range = mathElement.nextElementSibling.ownerDocument.createRange(); - range.setStart(mathElement.nextElementSibling.firstChild, 0); - focusByRange(range); - } - } + focusBlock(sideBlockElement); return; } const range = getEditorRange(updateElement);