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 layout bug: InvalidateMeasure the parent container as a recycled element is placed into it #312

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

danwalmsley
Copy link
Member

Imagine the datasource is reconfigured, causing the same elements to be displayed but they can end up different sizes.

(i.e. having a tree with children, then moving to a flat layout)

when you go from one layout to the next, the recycled cells may now have a different size, except they do not get re-measured / arranged (I assume for performance issues?)

This can cause many many layout issues that I have seen in various projects that use this.

This fix, invalidates the parent container, only if an item is being recycled.

I couldnt detect any noticable performance degradation in my app or in the sample app.

This fix is a catch all solution, and will get rid of the bug in all scenarios (I expect)

Another approach, might be to clear the cache of recycled elements if the datasource is changed.
(this would possibly fix my use case, but I know of other people who have this issue and it would not fix the issue for them)

@grokys grokys merged commit dcfffd6 into master Nov 5, 2024
3 checks passed
@grokys grokys deleted the fix/recycled-cells-not-getting-layed-out-correctly branch November 5, 2024 13:29
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.

2 participants