We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aedbd6b commit 626d5ecCopy full SHA for 626d5ec
app/src/layout/dock/Outline.ts
@@ -485,12 +485,8 @@ export class Outline extends Model {
485
}
486
if (currentElement) {
487
currentElement.classList.add("b3-list-item--focus");
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;
+ const elementRect = this.element.getBoundingClientRect();
+ this.element.scrollTop = this.element.scrollTop + (currentElement.getBoundingClientRect().top - (elementRect.top + elementRect.height / 2));
494
495
496
0 commit comments