mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-23 04:41:14 +00:00
Merge pull request #495 from LemmyNet/comment_scroll_bug
Fix comment scroll bug. Fixes #492
This commit is contained in:
commit
ebf216ccc9
1 changed files with 9 additions and 5 deletions
|
@ -218,12 +218,16 @@ export class Post extends Component<any, PostState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollCommentIntoView() {
|
scrollCommentIntoView() {
|
||||||
var elmnt = document.getElementById(`comment-${this.state.commentId}`);
|
let commentElement = document.getElementById(
|
||||||
elmnt.scrollIntoView();
|
`comment-${this.state.commentId}`
|
||||||
elmnt.classList.add("mark");
|
);
|
||||||
|
if (commentElement) {
|
||||||
|
commentElement.scrollIntoView();
|
||||||
|
commentElement.classList.add("mark");
|
||||||
this.state.scrolled = true;
|
this.state.scrolled = true;
|
||||||
this.markScrolledAsRead(this.state.commentId);
|
this.markScrolledAsRead(this.state.commentId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get checkScrollIntoCommentsParam() {
|
get checkScrollIntoCommentsParam() {
|
||||||
return Boolean(
|
return Boolean(
|
||||||
|
|
Loading…
Reference in a new issue