From 8345eba602711b8364d388569f73ed99b4ec7675 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 2 Oct 2022 12:44:28 +0800 Subject: [PATCH] :sparkles: fix https://github.com/siyuan-note/siyuan/issues/6042 --- app/src/layout/dock/Outline.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts index 730760e74..2d0f8c3a1 100644 --- a/app/src/layout/dock/Outline.ts +++ b/app/src/layout/dock/Outline.ts @@ -220,13 +220,7 @@ export class Outline extends Model { } if (currentElement) { currentElement.classList.add("b3-list-item--focus"); - const currentRect = currentElement.getBoundingClientRect(); - const scrollRect = this.element.getBoundingClientRect(); - if (currentRect.top < scrollRect.top) { - currentElement.scrollIntoView(); - } else if (currentRect.bottom > scrollRect.bottom) { - currentElement.scrollIntoView(false); - } + this.element.scrollTop = currentElement.offsetTop - this.element.clientHeight / 2 - 30; } }