Commit 6c190be0 authored by Mark Harding's avatar Mark Harding

Merge branch 'fix/group-conversations-scroll-issue' into 'master'

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

Closes #1428

See merge request !391
parents 609b05c1 a83bdf0b
Pipeline #69283565 passed with stages
in 30 minutes and 35 seconds
......@@ -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