Skip to content

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

:bug: focus

Vanessa2d127178a51b
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index e381359869..6830f7f761 100644
--- a/app/src/protyle/util/selection.ts
+++ b/app/src/protyle/util/selection.ts
@@ -311,7 +311,7 @@ export const setFirstNodeRange = (editElement: Element, range: Range) => {
range.selectNodeContents(editElement);
return range;
}
- if (firstChild.classList.contains("render-node")) {
+ if (firstChild.nodeType !== 3 && firstChild.classList.contains("render-node")) {
range.setStartBefore(firstChild);
} else {
range.setStart(firstChild, 0);