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

Fix crash that occurs when transitioning to a zero size view #271

Merged
merged 5 commits into from Mar 4, 2021

Conversation

kyleve
Copy link
Collaborator

@kyleve kyleve commented Mar 1, 2021

This fixes an issue that occurs when list view transitions from a sized view, to one with zero area. This happens because when the size transitions to a zero area view, we remove all content – it doesnt mean anything to lay out content that has no possible size. Unfortunately, when updating the visible content, we depend on the collection view's layout, which has not yet updated, and causes a crash due to returning content that no longer exists. The fix here is to return early in this case.

I think there might be a more holistic way to fix this by updating the visible content at a slightly different time, but this does the trick for now. I'll keep playing with it.

@kyleve kyleve requested a review from kylebshr March 1, 2021 21:49
@kyleve
Copy link
Collaborator Author

kyleve commented Mar 2, 2021

Took a better shot at this here: #273

@DJBen
Copy link

DJBen commented Mar 2, 2021

Thank you for the quick fix!

@kyleve kyleve merged commit 8c6df6c into main Mar 4, 2021
@kyleve kyleve deleted the kve/fix-to-zero-size-crash branch March 4, 2021 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants