-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Invalidate CollectionView Layout on transition to IsVisible = true #13370
Conversation
Are you missing a button with "RunTest" @hartez ? |
Yep, I forgot I changed the test to use Appearing. :( |
I have the same issue, but my CollectionView is inside some other view. |
@AlleSchonWeg I should clarify - it's not an issue if the container view is one that will be invalidated if one of its children changes its size or visibility. StackLayout, Grid, FlexLayout, etc. all recompute their layouts if a child control's visibility changes. There may be other containers which do not. I just included that note for folks who need an immediate workaround; wrapping the CollectionView in a StackLayout or Grid will fix the issue temporarily while waiting for the next release. It's all moot after this change is merged, because the CollectionView itself will invalidate its own layout after a visibility change. So it shouldn't matter what type the container is. |
It'd be unusual, but I suppose a situation where the user is holding on to ItemsView and reusing it in another renderer could leak the controller. Added the unsubscribe during Dispose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rachelkang those failures are not relevant |
Description of Change
If the CollectionView is the root Content element for a page on iOS and IsVisible transitions from false to true, the CollectionView's layout is not invalidating. This change invalidates the layout so that the CollectionView is refreshed.
Note that this isn't an issue if the CollectionView is inside some other view (e.g., a StackLayout); it's only an issue if it's the root of the page Content.
Issues Resolved
IsVisible=False
#13203API Changes
None
Platforms Affected
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
Automated UI test
PR Checklist