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

CollectionView OnCollectionViewScrolled Calls and parameters are inconsistent or incorrect #25649

Open
david-maw opened this issue Nov 3, 2024 · 1 comment
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

Comments

@david-maw
Copy link

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:
Image
Now build and run it on Android and you should see this:
Image

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:

  1. The same call was not made on Windows (the information was blank)
  2. The LastVisibleItemIndex value is 2 but the last visible item is actually at index 1.

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:
Image

  1. On the screen you can see item 1 through most of item 7 but the call on OnCollectionViewScrolled indicated "Item 2 to Item 8"

  2. 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

@david-maw david-maw added the t/bug Something isn't working label Nov 3, 2024
@jaosnz-rep jaosnz-rep added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed platform/windows 🪟 platform/android 🤖 labels Nov 4, 2024
@jaosnz-rep
Copy link

jaosnz-rep commented Nov 4, 2024

I can repro this issue at Windows & Android platform on the latest 17.12.0 preview 5(9.0.0-rc.1.24453.9 & 9.0.0-rc.2.24503.2 & 8.0.82).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants