From e45f5998c1ee8ff45054c146591be8785444a937 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 2 Mar 2023 10:34:56 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/7541 --- app/src/protyle/util/selection.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts index 46cda580d..447a2372e 100644 --- a/app/src/protyle/util/selection.ts +++ b/app/src/protyle/util/selection.ts @@ -210,7 +210,10 @@ export const getSelectionPosition = (nodeElement: Element, range?: Range) => { } } else { const rects = range.getClientRects(); // 由于长度过长折行,光标在行首时有多个 rects https://github.com/siyuan-note/siyuan/issues/6156 - cursorRect = rects[rects.length - 1]; + return { // 选中多行不应遮挡第一行 https://github.com/siyuan-note/siyuan/issues/7541 + left: rects[rects.length - 1].left, + top: rects[0].top + } } return {