Fix anchor link scrolling on load (chrome)

This commit is contained in:
hunicus committed 2022-06-11 12:21:08 -04:00
1 parent 13332e4089
commit 3024aff26c
1 file changed
+1
@@ -35,6 +35,7 @@ export class ApiDocsComponent implements OnInit {
setTimeout( () => {
if( this.route.snapshot.fragment ) {
this.openEndpointContainer( this.route.snapshot.fragment );
document.getElementById( this.route.snapshot.fragment ).scrollIntoView();
}
window.addEventListener('scroll', function() {
that.desktopDocsNavPosition = ( window.pageYOffset > 182 ) ? "fixed" : "relative";