File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ app/stage/build
14
14
app /build
15
15
app /src /types /dist
16
16
app /kernel *
17
+ app /SiYuan-Kernel
17
18
ios
18
19
pprof
19
20
Original file line number Diff line number Diff line change @@ -485,7 +485,12 @@ export class Outline extends Model {
485
485
}
486
486
if ( currentElement ) {
487
487
currentElement . classList . add ( "b3-list-item--focus" ) ;
488
- this . element . scrollTop = currentElement . offsetTop - this . element . clientHeight / 2 - 30 ;
488
+
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 ;
489
494
}
490
495
}
491
496
You can’t perform that action at this time.
0 commit comments