mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 22:49:33 +00:00
Fix comment scroll bug. Fixes #492
This commit is contained in:
parent
b133406568
commit
aff768edaa
|
@ -218,11 +218,15 @@ export class Post extends Component<any, PostState> {
|
|||
}
|
||||
|
||||
scrollCommentIntoView() {
|
||||
var elmnt = document.getElementById(`comment-${this.state.commentId}`);
|
||||
elmnt.scrollIntoView();
|
||||
elmnt.classList.add("mark");
|
||||
this.state.scrolled = true;
|
||||
this.markScrolledAsRead(this.state.commentId);
|
||||
let commentElement = document.getElementById(
|
||||
`comment-${this.state.commentId}`
|
||||
);
|
||||
if (commentElement) {
|
||||
commentElement.scrollIntoView();
|
||||
commentElement.classList.add("mark");
|
||||
this.state.scrolled = true;
|
||||
this.markScrolledAsRead(this.state.commentId);
|
||||
}
|
||||
}
|
||||
|
||||
get checkScrollIntoCommentsParam() {
|
||||
|
|
Loading…
Reference in a new issue