Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/7541

Vanessae45f5998c1ee
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index 46cda580d0..447a2372ef 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 {