Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] CollectionView.Scrolled event offset isn't correctly reset when items change #7993

Closed
kimbirkelund opened this issue Oct 14, 2019 · 7 comments
Labels
in-progress This issue has an associated pull request that may resolve it! s/unverified New report that has yet to be verified t/bug 🐛

Comments

@kimbirkelund
Copy link

kimbirkelund commented Oct 14, 2019

Description

When changing the contents of the CollectionView.ItemsSource while scrolled down into the list, the ItemsViewScrolledEventArgs.VerticalOffset is correctly updated.

Steps to Reproduce

  1. Run attached project
  2. Press the Fill button
  3. Scroll in the list (notice the VerticalOffset label updates to show position)
  4. Press Empty button
  5. Repeat from 2 at you leasure

Expected Behavior

The value of VerticalOffset should be reset, when pressing Empty, to reflect that the view is no longer scrolled - or at least, as is the case on iOS, the value should be reset the next time scrolling is performed. I'd prefer the former.

Actual Behavior

The value of VerticalOffset on Android keeps incrementing and never returns to 0. On iOS it returns to zero the next time scrolling is performed.

Basic Information

  • Version with issue: 4.3.0.851321-pre3
  • Last known good version: none

Screenshots

IMAGE ALT TEXT HERE

Reproduction Link

App6.zip

@adrianknight89
Copy link
Contributor

I knew this was going to come up at some point. :) See #8018.

@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Oct 15, 2019
CliffAgius pushed a commit to CliffAgius/Xamarin.Forms that referenced this issue Dec 6, 2019
@taublast
Copy link

taublast commented Sep 5, 2020

Forms 4.7, collectionView gets correct VerticalOffset in OnScrolled event received, after i once refresh the collectionView being inside RefresfView it visually resets ok to zero, but the VerticalOffset in OnScrolled event received is not correct anymore, the minumum it gets is around 6-9.
The position on screen is well 0, but this 0 is reported as a non-zero positive value, the internal calculation might be bugged. That random value is maybe the bouncing offset it had while jumping inside refreshView..

@LittleBoxOfChicken
Copy link

Forms 4.8, this issue is still the case on Android. ScrollTo() and changing the ItemSource cause incorrect offsets. Both for HorizontalOffset and VerticalOffset.

@tonyfonager
Copy link

And I can confirm on XF 5.0.0.1874 (Android) this is still an issue!

@Cfun1
Copy link

Cfun1 commented Apr 11, 2021

@PureWeen I can confirm the issue with wrong scroll offset still happening when adding and then removing the same items, do you suggest reopen this or create another issue ?

@yunusefendi52
Copy link

@Cfun1 I think removing items (i.e remove or Clear) is not going to fix vertical offset, according to the test inside the PR #8018 you have to assign new ItemsSource

@valentasm1
Copy link

I think it is related to #10966

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in-progress This issue has an associated pull request that may resolve it! s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

9 participants