Skip to content

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

:bug: fix https://github.com/siyuan-note/siyuan/issues/5048

Vanessa9edf50f9c482
diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts
index 7263f2c29e..88fa3f5f5d 100644
--- a/app/src/layout/Wnd.ts
+++ b/app/src/layout/Wnd.ts
@@ -352,8 +352,13 @@ export class Wnd {
}
let oldFocusIndex = 0;
this.children.forEach((item, index) => {
- if (item.headElement?.classList.contains("item--focus")) {
+ if (item.headElement && item.headElement.classList.contains("item--focus")) {
oldFocusIndex = index;
+ let nextElement = item.headElement.nextElementSibling;
+ while (nextElement && nextElement.classList.contains("item--pin")) {
+ oldFocusIndex++;
+ nextElement = nextElement.nextElementSibling;
+ }
}
if (!keepCursor) {
item.headElement?.classList.remove("item--focus");