From 43483d12963ed7a82adee2e35a7bcb7e55e54b3e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Jan 2019 15:16:54 +0100 Subject: Correctly scroll to video comment --- .../src/app/videos/+video-watch/comment/video-comments.component.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'client/src/app/videos/+video-watch/comment') diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts index dc62fe5ae..2616820d2 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts @@ -83,11 +83,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { this.highlightedThread = new VideoComment(res.comment) // Scroll to the highlighted thread - setTimeout(() => { - // -60 because of the fixed header - const scrollY = this.commentHighlightBlock.nativeElement.offsetTop - 60 - window.scroll(0, scrollY) - }, 500) + setTimeout(() => this.commentHighlightBlock.nativeElement.scrollIntoView(), 0) } }, -- cgit v1.2.3