mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Merge pull request #1555 from politan8/bugfix/scroll
#1529 fix for collection view content inset
This commit is contained in:
@@ -6,6 +6,8 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixes an issue with Scroll problem on new messages with keyboard open [#1529](https://github.com/MessageKit/MessageKit/pull/1529) by [@politan8](https://github.com/politan8)
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
@@ -98,6 +98,10 @@ internal extension MessagesViewController {
|
||||
let newBottomInset = requiredScrollViewBottomInset(forKeyboardFrame: keyboardEndFrame)
|
||||
let differenceOfBottomInset = newBottomInset - messageCollectionViewBottomInset
|
||||
|
||||
UIView.performWithoutAnimation {
|
||||
messageCollectionViewBottomInset = newBottomInset
|
||||
}
|
||||
|
||||
if maintainPositionOnKeyboardFrameChanged && differenceOfBottomInset != 0 {
|
||||
let contentOffset = CGPoint(x: messagesCollectionView.contentOffset.x, y: messagesCollectionView.contentOffset.y + differenceOfBottomInset)
|
||||
// Changing contentOffset to bigger number than the contentSize will result in a jump of content
|
||||
@@ -107,10 +111,6 @@ internal extension MessagesViewController {
|
||||
}
|
||||
messagesCollectionView.setContentOffset(contentOffset, animated: false)
|
||||
}
|
||||
|
||||
UIView.performWithoutAnimation {
|
||||
messageCollectionViewBottomInset = newBottomInset
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Inset Computation
|
||||
|
||||
Reference in New Issue
Block a user