We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent e472f71 commit aedbd6bCopy full SHA for aedbd6b
.gitignore
@@ -14,6 +14,7 @@ app/stage/build
14
app/build
15
app/src/types/dist
16
app/kernel*
17
+app/SiYuan-Kernel
18
ios
19
pprof
20
app/src/layout/dock/Outline.ts
@@ -485,7 +485,12 @@ export class Outline extends Model {
485
}
486
if (currentElement) {
487
currentElement.classList.add("b3-list-item--focus");
488
- this.element.scrollTop = currentElement.offsetTop - this.element.clientHeight / 2 - 30;
+
489
+ const targetRect = currentElement.getBoundingClientRect();
490
+ const containerRect = this.element.getBoundingClientRect();
491
+ const relativeTop = targetRect.top - containerRect.top + this.element.scrollTop;
492
493
+ this.element.scrollTop = relativeTop - this.element.clientHeight / 2 - 30;
494
495
496
0 commit comments