You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[10.0.90] ScrollTo(0) not working anymore on CollectionView when IsGrouped="True" #37259
This issue has been validated in Visual Studio Code 1.132.0 with .NET MAUI versions 10.0.80 and 10.0.90. It can be reproduced on the Android platform from 10.0.90.
In the sample, the scroll operation uses ScrollTo(54), which assumes that group headers are counted as items and therefore targets the last item in the list. However, on other platforms, group headers were already not considered as items for indexing. Starting with version 10.0.90, Android was aligned with this existing behavior across other platforms. Therefore, you can use either of the following approaches to achieve the same scenario:
Use collectionView.ScrollTo(49) or
Use group-based indexing: collectionView.ScrollTo( index: 9, groupIndex: 4)
@vishnumenon2684
How do you scroll to the top? (not the first item, but the first group header)
How do you scroll to the end? (not the last item, but the last group footer)
Hi @tranb3r
For scroll to the top (not the first item, for the first group header) , use the below line of code: MyCollectionView.ScrollTo(0, position: ScrollToPosition.Center);
To scroll to the end (not the last item, for the last group footer), use the below line of code: MyCollectionView.ScrollTo(49, position: ScrollToPosition.Center);
I validated this end-to-end in the MAUI Sandbox on the exact 10.0.80 and 10.0.90 source tags, using the same grouped data as the repro (5 groups × 10 items).
Result
This appears to be an intentional index-semantics change rather than ScrollTo(0) failing:
10.0.80:ScrollTo(54) reaches the last item because Android effectively counts the 5 group headers in the flat index. ScrollTo(0) then returns with the first group header visible.
10.0.90: the flat index counts only the 50 data items. Therefore ScrollTo(54) is out of range and leaves the list at the top, which makes the following ScrollTo(0) look like a no-op.
On 10.0.90, after a valid ScrollTo(49, Center), plain ScrollTo(0) does return to the first data item. The first group header is just above the viewport because the default position is MakeVisible.
I also added actual group footers and tested both suggestions from #37259 (comment):
On 10.0.90 these expose the first group header and last group footer respectively.
Videos
MAUI 10.0.80
issue-37259-android-maui-10.0.80-playable.mp4
MAUI 10.0.90
issue-37259-android-maui-10.0.90-playable.mp4
Environment: Android 15 / API 35 emulator (sdk_gphone64_arm64), net10.0-android; exact MAUI tag commits f9b311be07682fbe1714a18eba44d85ef24180fe and 8e2547a4707f745a27a7791495b240e756926980.
Source history supports this interpretation: PR #35823 intentionally changed Android to map a flat data-item index to the native adapter position while excluding group headers/footers. That also matches the public API wording, which describes index as the zero-based index of the item.
One nuance: the statement that this behavior already existed uniformly on all other platforms is broader than the history I found—iOS/Mac grouped flat-index handling was also changed around this release in PR #35609. But the 10.0.90 Android behavior itself is clearly intentional.
Activity
NafeelaNazhir commentedon Aug 10, 2026
This issue has been validated in Visual Studio Code 1.132.0 with .NET MAUI versions 10.0.80 and 10.0.90. It can be reproduced on the Android platform from 10.0.90.
Screen.Recording.2026-08-10.at.4.26.31.PM.mov
Screen.Recording.2026-08-10.at.4.22.07.PM.mov
vishnumenon2684 commentedon Aug 10, 2026
Hi @tranb3r
In the sample, the scroll operation uses ScrollTo(54), which assumes that group headers are counted as items and therefore targets the last item in the list. However, on other platforms, group headers were already not considered as items for indexing. Starting with version 10.0.90, Android was aligned with this existing behavior across other platforms. Therefore, you can use either of the following approaches to achieve the same scenario:
Use
collectionView.ScrollTo(49)orUse group-based indexing:
collectionView.ScrollTo( index: 9, groupIndex: 4)tranb3r commentedon Aug 10, 2026
@vishnumenon2684
How do you scroll to the top? (not the first item, but the first group header)
How do you scroll to the end? (not the last item, but the last group footer)
vishnumenon2684 commentedon Aug 11, 2026
Hi @tranb3r
For scroll to the top (not the first item, for the first group header) , use the below line of code:
MyCollectionView.ScrollTo(0, position: ScrollToPosition.Center);To scroll to the end (not the last item, for the last group footer), use the below line of code:
MyCollectionView.ScrollTo(49, position: ScrollToPosition.Center);kubaflo commentedon Aug 11, 2026
I validated this end-to-end in the MAUI Sandbox on the exact
10.0.80and10.0.90source tags, using the same grouped data as the repro (5 groups × 10 items).Result
This appears to be an intentional index-semantics change rather than
ScrollTo(0)failing:ScrollTo(54)reaches the last item because Android effectively counts the 5 group headers in the flat index.ScrollTo(0)then returns with the first group header visible.ScrollTo(54)is out of range and leaves the list at the top, which makes the followingScrollTo(0)look like a no-op.ScrollTo(49, Center), plainScrollTo(0)does return to the first data item. The first group header is just above the viewport because the default position isMakeVisible.I also added actual group footers and tested both suggestions from #37259 (comment):
On 10.0.90 these expose the first group header and last group footer respectively.
Videos
MAUI 10.0.80
issue-37259-android-maui-10.0.80-playable.mp4
MAUI 10.0.90
issue-37259-android-maui-10.0.90-playable.mp4
Environment: Android 15 / API 35 emulator (
sdk_gphone64_arm64),net10.0-android; exact MAUI tag commitsf9b311be07682fbe1714a18eba44d85ef24180feand8e2547a4707f745a27a7791495b240e756926980.Source history supports this interpretation: PR #35823 intentionally changed Android to map a flat data-item index to the native adapter position while excluding group headers/footers. That also matches the public API wording, which describes
indexas the zero-based index of the item.One nuance: the statement that this behavior already existed uniformly on all other platforms is broader than the history I found—iOS/Mac grouped flat-index handling was also changed around this release in PR #35609. But the 10.0.90 Android behavior itself is clearly intentional.