Skip to content

Commit 8182d92

Browse files
EvilAlexeivalorkin
authored andcommitted
fix(demo): fix add-nav scroll to selected sections (#3593)
1 parent 50defdd commit 8182d92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo/src/app/common/add-nav/add-nav.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export class AddNavComponent {
1919
const anchor: string = item.dataset.anchor;
2020
const target: HTMLElement = this.document.getElementById(anchor);
2121
const header: HTMLElement = this.document.getElementById('header');
22-
const headerIndent: number = header.offsetHeight + 6;
23-
this.document.body.scrollTop = target.offsetTop - headerIndent;
22+
const targetPosY: number = target.offsetTop - header.offsetHeight - 6;
23+
window.scrollTo(0, targetPosY);
2424
}
2525
}
2626
}

0 commit comments

Comments
 (0)