Skip to content

Commit 2c47611

Browse files
committed
🎨 #14265
1 parent c1b01b7 commit 2c47611

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/src/layout/dock/Files.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,12 +1110,8 @@ data-type="navigation-root" data-path="/">
11101110
target.classList.add("b3-list-item--focus");
11111111

11121112
if (isScroll) {
1113-
const targetRect = target.getBoundingClientRect();
1114-
const containerRect = this.element.getBoundingClientRect();
1115-
1116-
const relativeTop = targetRect.top - containerRect.top + this.element.scrollTop;
1117-
1118-
this.element.scrollTop = relativeTop - this.element.clientHeight / 2 - this.actionsElement.clientHeight;
1113+
const elementRect = this.element.getBoundingClientRect();
1114+
this.element.scrollTop = this.element.scrollTop + (target.getBoundingClientRect().top - (elementRect.top + elementRect.height / 2));
11191115
}
11201116
}
11211117

0 commit comments

Comments
 (0)