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

[iOS] CollectionView with header and "complex" item will have the wrong position after a refresh with a RefreshView #26575

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

Issue Details:

CollectionView scrolled to wrong position after a refresh with RefreshView.

Root Cause:

After the refresh process is completed, the UIRefreshControl resets the contentOffset to 0, which is below the position of the header view. As a result, the UICollectionView scrolls to this adjusted contentOffset, causing the collection view is scrolled to 1st item.

Description of Change :

I explicitly set the contentOffset in the TryOffsetRefresh method of MauiRefreshView to ensure the view scrolls back to the header position after a refresh operation is completed.

Issues Fixed

Fixes #24961

Tested the behavior in the following platforms.
-[x] Android
-[x] Windows
-[x] iOS
-[x] Mac

Output Screenshot

Before After
Before_Issue24961.mov
After_Issue24961.mov

…ng position after a refresh with a RefreshView

Fixed - [iOS] CollectionView with header and "complex" item will have the wrong position after a refresh with a RefreshView
…ng position after a refresh with a RefreshView

Fix-Included
Test case added and attached screenshot for iOS and Android platform.
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Dec 12, 2024
@jfversluis jfversluis added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Dec 12, 2024
Removed comments in test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution
Projects
None yet
3 participants