Przeglądaj źródła

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

Vanessa 3 lat temu
rodzic
commit
9edf50f9c4
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      app/src/layout/Wnd.ts

+ 6 - 1
app/src/layout/Wnd.ts

@@ -352,8 +352,13 @@ export class Wnd {
         }
         }
         let oldFocusIndex = 0;
         let oldFocusIndex = 0;
         this.children.forEach((item, index) => {
         this.children.forEach((item, index) => {
-            if (item.headElement?.classList.contains("item--focus")) {
+            if (item.headElement && item.headElement.classList.contains("item--focus")) {
                 oldFocusIndex = index;
                 oldFocusIndex = index;
+                let nextElement = item.headElement.nextElementSibling;
+                while (nextElement && nextElement.classList.contains("item--pin")) {
+                    oldFocusIndex++;
+                    nextElement = nextElement.nextElementSibling;
+                }
             }
             }
             if (!keepCursor) {
             if (!keepCursor) {
                 item.headElement?.classList.remove("item--focus");
                 item.headElement?.classList.remove("item--focus");