Quick fix scrolling bug

This commit is contained in:
Niels Andriesse 2021-02-25 10:50:14 +11:00
parent a0b2c40c2a
commit cdd9878eb1
1 changed files with 4 additions and 0 deletions

View File

@ -217,7 +217,11 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat
scrollButton.pin(.bottom, to: .bottom, of: view, withInset: -(newHeight + 16))
didConstrainScrollButton = true
}
let shouldScroll = (newHeight > 200) // Arbitrary value that's higher than the collapsed size and lower than the expanded size
UIView.animate(withDuration: 0.25) {
if shouldScroll {
self.messagesTableView.contentOffset.y += (newHeight - self.messagesTableView.keyboardHeight)
}
self.messagesTableView.keyboardHeight = newHeight
self.scrollButton.alpha = 0
}