From c998d302e59e402a50f5ab35e4561196f470d7d3 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO Date: Tue, 30 Mar 2021 10:35:14 +1100 Subject: [PATCH] fix faulty scrolling caused by keyboard for new conversations --- Session/Conversations/ConversationVC.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 56dd409cb..a350ebdca 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -298,8 +298,8 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat scrollButton.pin(.bottom, to: .bottom, of: view, withInset: -(newHeight + 16)) // + 16 to match the bottom inset of the table view didConstrainScrollButton = true } - let newContentOffsetY = self.messagesTableView.contentOffset.y + newHeight - self.messagesTableView.keyboardHeight - self.messagesTableView.contentOffset.y = newContentOffsetY + let newContentOffsetY = self.messagesTableView.contentOffset.y + min(lastPageTop, 0) + newHeight - self.messagesTableView.keyboardHeight + self.messagesTableView.contentOffset.y = max(self.messagesTableView.contentOffset.y, newContentOffsetY) self.messagesTableView.keyboardHeight = newHeight self.scrollButton.alpha = 0 }