diff --git a/CHANGELOG.md b/CHANGELOG.md index 0923196c6..11eca3ce6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Fixed +- [When updating `contentInset`, retain the values pulled from the `CollectionView`](TODO). This is to avoid clobbering the content inset potentially set by other things like navigation controllers. + ### Added ### Removed diff --git a/ListableUI/Sources/ListView/ListView.swift b/ListableUI/Sources/ListView/ListView.swift index 92298f3db..1d1a505dc 100644 --- a/ListableUI/Sources/ListView/ListView.swift +++ b/ListableUI/Sources/ListView/ListView.swift @@ -325,12 +325,9 @@ public final class ListView : UIView, KeyboardObserverDelegate $0.bottom = max($0.bottom, keyboardBottomInset) } - let contentInsets = UIEdgeInsets( - top: 0, - left: 0, - bottom: keyboardBottomInset, - right: 0 - ) + let contentInsets = modified(self.collectionView.contentInset) { + $0.bottom = keyboardBottomInset + } return (contentInsets, scrollIndicatorInsets) }