瀏覽代碼

:sparkles: fix https://github.com/siyuan-note/siyuan/issues/6033

Vanessa 2 年之前
父節點
當前提交
3df605d2e7
共有 1 個文件被更改,包括 1 次插入6 次删除
  1. 1 6
      app/src/layout/dock/Files.ts

+ 1 - 6
app/src/layout/dock/Files.ts

@@ -772,12 +772,7 @@ export class Files extends Model {
             liItem.classList.remove("b3-list-item--focus");
             liItem.classList.remove("b3-list-item--focus");
         });
         });
         target.classList.add("b3-list-item--focus");
         target.classList.add("b3-list-item--focus");
-        const titleHeight = this.actionsElement.clientHeight;
-        if (target.offsetTop - titleHeight < this.element.scrollTop) {
-            this.element.scrollTop = target.offsetTop - titleHeight;
-        } else if (target.offsetTop - this.element.clientHeight - titleHeight + target.clientHeight > this.element.scrollTop) {
-            this.element.scrollTop = target.offsetTop - this.element.clientHeight - titleHeight + target.clientHeight;
-        }
+        this.element.scrollTop = target.offsetTop - this.element.clientHeight / 2 - this.actionsElement.clientHeight;
     }
     }
 
 
     public getLeaf(liElement: Element, notebookId: string) {
     public getLeaf(liElement: Element, notebookId: string) {