Commit a83bdf0b authored by Marcelo Rivera's avatar Marcelo Rivera Committed by Mark Harding

[Sprint/HipsterHedgehog] (fix): only scroll bottom on new message if already on bottom

parent 609b05c1
......@@ -201,7 +201,10 @@ export class CommentsThreadComponent {
guid: guid,
parent_path: parent_path,
});
// if the list is scrolled to the bottom
let scrolledToBottom = this.scrollView.nativeElement.scrollTop + this.scrollView.nativeElement.clientHeight >= this.scrollView.nativeElement.scrollHeight;
if (comment) {
await this.loadBlockedUsers();
this.comments.push(comment);
......@@ -209,8 +212,11 @@ export class CommentsThreadComponent {
this.detectChanges();
this.commentsScrollEmitter.emit('bottom');
this.scrollToBottom.next(true);
if (scrolledToBottom) {
this.commentsScrollEmitter.emit('bottom');
this.scrollToBottom.next(true);
}
} catch (err) { };
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment