diff --git a/CHANGELOG.md b/CHANGELOG.md index 70bc891a..6d5853b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ### Fixed +- Fixed an issue where animations would occur when dequeuing / reusing cells. A layout is now forced without animation before presentation. + ### Added ### Removed diff --git a/ListableUI/Sources/Internal/PresentationState/PresentationState.HeaderFooterState.swift b/ListableUI/Sources/Internal/PresentationState/PresentationState.HeaderFooterState.swift index 03bc1dc1..eaaece38 100644 --- a/ListableUI/Sources/Internal/PresentationState/PresentationState.HeaderFooterState.swift +++ b/ListableUI/Sources/Internal/PresentationState/PresentationState.HeaderFooterState.swift @@ -150,11 +150,15 @@ extension PresentationState HeaderFooterContentView(frame: frame) } - self.applyTo( - view: view, - for: .willDisplay, - with: .init(environment: environment) - ) + UIView.performWithoutAnimation { + self.applyTo( + view: view, + for: .willDisplay, + with: .init(environment: environment) + ) + + view.layoutIfNeeded() + } return view } diff --git a/ListableUI/Sources/Internal/PresentationState/PresentationState.ItemState.swift b/ListableUI/Sources/Internal/PresentationState/PresentationState.ItemState.swift index 891687e7..e671419e 100644 --- a/ListableUI/Sources/Internal/PresentationState/PresentationState.ItemState.swift +++ b/ListableUI/Sources/Internal/PresentationState/PresentationState.ItemState.swift @@ -259,12 +259,16 @@ extension PresentationState let itemState = ListableUI.ItemState(cell: cell, isReordering: false) - self.applyTo( - cell: cell, - itemState: itemState, - reason: .willDisplay, - environment: environment - ) + UIView.performWithoutAnimation { + self.applyTo( + cell: cell, + itemState: itemState, + reason: .willDisplay, + environment: environment + ) + + cell.layoutIfNeeded() + } return cell }