Skip to content

Commit 250fcc4

Browse files
amcdnljelbourn
authored andcommittedSep 5, 2017
fix(toc): highlight wrong item on jump #256 (#258)
1 parent 43f33ed commit 250fcc4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎material.angular.io/src/app/shared/table-of-contents/table-of-contents.ts

+5-1
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)
Please sign in to comment.