CollectionView OnCollectionViewScrolled Calls and parameters are inconsistent or incorrect #25649
Labels
platform/android 🤖
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Description
OnCollectionViewScrolled has a parameter that includes FirstVisibleItemIndex and LastVisibleItemIndex. It is not initially called in Windows but when it eventually is the values seem to be correct. On Android it is called initially, but the values are not correct (usually they are off by 1)
Steps to Reproduce
Forst clone the repository then build and run the app on Windows, you should see this:
Now build and run it on Android and you should see this:
Note that the "parameter" information indicates "Item 0 to Item 2", this is derived from a call on OnCollectionViewScrolled and there are two things to note:
Now check the "long list" box at the bottom of the page and the CollectionView will be populated with a longer list. Scroll it up one item and you'll see this:
On the screen you can see item 1 through most of item 7 but the call on OnCollectionViewScrolled indicated "Item 2 to Item 8"
Finally, go back to Windows and try the long list, note that SnapPointsType="Mandatory" seems to have no effect.
Link to public reproduction project repository
https://github.com/david-maw/OnCollectionViewScrolled.git
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Android 11 Windows 11
Did you find any workaround?
No, it fails both in .NET 8 and 9.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: