Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit 2aaff11

Browse files
amcdnljelbourn
authored andcommitted
fix(toc): highlight wrong item on jump #256 (#258)
1 parent 8f1d6f6 commit 2aaff11

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/shared/table-of-contents/table-of-contents.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ export class TableOfContents implements OnInit {
5858

5959
this._fragmentSubscription = this._route.fragment.subscribe(fragment => {
6060
this._urlFragment = fragment;
61-
this.updateScrollPosition();
61+
62+
const target = document.getElementById(this._urlFragment);
63+
if (target) {
64+
target.scrollIntoView();
65+
}
6266
});
6367
}
6468

0 commit comments

Comments
 (0)