Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear cached layout attributes if the data source counts change #125

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

bryankeller
Copy link
Contributor

@bryankeller bryankeller commented Mar 8, 2024

Details

I meant to include this with my last PR - this fixes an issue that causes off-screen cells coming into view due to a batch update to use incorrect layout attributes, causing them to have an incorrect size during the animation. In the video below, you can see that cell 0 is deleted, cell 1 animates in from above the top edge of the screen, and incorrectly reuses the cached layout attributes of cell 2 (new cell 1 after updates), which is a really tall cell.

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-06.at.17.50.04.mp4

Related Issue

N/A

Motivation and Context

Bug fix

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@bryankeller bryankeller requested a review from brynbodayle March 8, 2024 19:43
@bryankeller bryankeller added the bug Something isn't working label Mar 8, 2024
@bryankeller bryankeller merged commit 281c390 into master Mar 8, 2024
2 checks passed
@bryankeller bryankeller deleted the bk/better-layout-attributes-cache-invalidation branch March 8, 2024 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants