Skip to content

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

:art: https://github.com/siyuan-note/siyuan/pull/14265

Vanessa2c476118c3fe
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 942afe0963..7c8ea921e0 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -1110,12 +1110,8 @@ data-type="navigation-root" data-path="/">
target.classList.add("b3-list-item--focus");
if (isScroll) {
- const targetRect = target.getBoundingClientRect();
- const containerRect = this.element.getBoundingClientRect();
-
- const relativeTop = targetRect.top - containerRect.top + this.element.scrollTop;
-
- this.element.scrollTop = relativeTop - this.element.clientHeight / 2 - this.actionsElement.clientHeight;
+ const elementRect = this.element.getBoundingClientRect();
+ this.element.scrollTop = this.element.scrollTop + (target.getBoundingClientRect().top - (elementRect.top + elementRect.height / 2));
}
}