Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Prevent overeager cache invalidation when the CollectionView height changes by very small amounts #13738

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Feb 12, 2021

Description of Change

Under the right layout circumstances, the UICollectionView's size can repeatedly change by very, very small amounts (height differences less than 0.0001). The layout cell sizes cache was blindly invalidating even for very small changes, which caused layout jumps and incorrect scrollbar positions.

These changes prevent cache invalidation in those scenarios.

Issues Resolved

API Changes

None

Platforms Affected

  • iOS

Behavioral/Visual Changes

None

Before/After Screenshots

Not applicable

Testing Procedure

Grab the repro project from #13231 and update it to this PR; the CollectionView should scroll smoothly and should scroll all the way to the bottom of the last item. If the last item will no scroll fully into view, this PR is failing.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@hartez hartez added this to To Fix in 5.0.0 SR 3 via automation Feb 12, 2021
@hartez hartez moved this from To Fix to PR Needs Review in 5.0.0 SR 3 Feb 12, 2021
@PureWeen PureWeen merged commit 68c1777 into 5.0.0 Feb 12, 2021
5.0.0 SR 3 automation moved this from PR Needs Review to Done Feb 12, 2021
@PureWeen PureWeen deleted the fix-13719 branch February 12, 2021 03:31
@samhouts samhouts added this to the 5.0.0 milestone Feb 12, 2021
@samhouts samhouts added 5.0.0 Regression on 5.0.0 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛 labels Feb 13, 2021
jfversluis added a commit that referenced this pull request Jan 20, 2022
…height changes by very small amounts (#13738)"

This reverts commit 68c1777.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
5.0.0 Regression on 5.0.0 a/collectionview i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often t/bug 🐛
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[Bug] Regression: XF nightly completely broke CollectionView scrolling
4 participants