fix growing issue in small thread

This commit is contained in:
Nicolas Constant 2019-08-16 22:06:06 -04:00
parent 716819524b
commit 113cefb36f
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 5 additions and 4 deletions

View File

@ -611,14 +611,15 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
let scrolling = (this.replyElement.nativeElement.scrollHeight);
if (scrolling > 110) {
const isVisible = this.checkVisible(this.footerElement.nativeElement);
this.replyElement.nativeElement.style.height = `0px`;
this.replyElement.nativeElement.style.height = `${this.replyElement.nativeElement.scrollHeight}px`;
setTimeout(() => {
if (this.checkVisible(this.footerElement.nativeElement)) {
if (isVisible) {
setTimeout(() => {
this.footerElement.nativeElement.scrollIntoViewIfNeeded({ behavior: 'instant', block: 'end', inline: 'start' });
}
}, 0);
}, 0);
}
}
}