From 6c94a675f0dbef0633bd1ad64aead78815bd3b62 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 24 Jan 2019 15:52:10 +0100 Subject: [PATCH] MOBILE-2841 messages: Fix scroll bottom in iOS devices --- src/addon/messages/pages/discussion/discussion.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/addon/messages/pages/discussion/discussion.ts b/src/addon/messages/pages/discussion/discussion.ts index b3151026e..25cdcab13 100644 --- a/src/addon/messages/pages/discussion/discussion.ts +++ b/src/addon/messages/pages/discussion/discussion.ts @@ -352,8 +352,9 @@ export class AddonMessagesDiscussionPage implements OnDestroy { } // Check if we are at the bottom to scroll it after render. - this.scrollBottom = this.domUtils.getScrollHeight(this.content) - this.domUtils.getScrollTop(this.content) === - this.domUtils.getContentHeight(this.content); + // Use a 5px error margin because in iOS there is 1px difference for some reason. + this.scrollBottom = Math.abs(this.domUtils.getScrollHeight(this.content) - this.domUtils.getScrollTop(this.content) - + this.domUtils.getContentHeight(this.content)) < 5; if (this.messagesBeingSent > 0) { // Ignore polling due to a race condition.