The Wayback Machine - https://web.archive.org/web/20201125013505/https://github.com/xamarin/Xamarin.Forms/pull/12053
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

Fixed ScrollY when ItemsSource reloaded or row height changed #12053

Open
wants to merge 1 commit into
base: 5.0.0
from

Conversation

@rihadavid
Copy link

@rihadavid rihadavid commented Sep 8, 2020

Fixes two issues with ListView scroll event ScrollY value that were making it pretty unreliable and buggy.

Original code was commited in this commit

I'm not 100% sure if there can't be any other situation when the scroll fails to be tracked (maybe some fast scroll?), for which setting the _contentOffset to 0 might not be correct, but it fixes the "reloaded ItemsSource" issue, which seems to be the most common. When we are not able to track the offset at all, it's a bug anyway, so setting the offset to 0 seems good because it solves this issue at least.

Issues Resolved

API Changes

None

Platforms Affected

  • Android

Behavioral/Visual Changes

ScrollY value in Scrolled event might sometimes be different than before, because it's now fixed.

Testing Procedure

I tested the sample project in #8305 and #9370 and confirmed it is fixed. However, it might be good to test that setting the _contentOffset to 0 doesn't create any side effects in different situations.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
@rihadavid rihadavid changed the title Update ListViewRenderer.cs Fixed ScrollY when ItemsSource reloaded or row height changed Sep 8, 2020
@samhouts samhouts requested review from jsuarezruiz and StephaneDelcroix Sep 8, 2020
@samhouts samhouts added this to In Review in vNext+1 (5.0.0) Sep 8, 2020
@PureWeen PureWeen added this to In progress in v5.0.1 via automation Nov 5, 2020
@PureWeen PureWeen removed this from In Review in vNext+1 (5.0.0) Nov 5, 2020
@samhouts samhouts added this to In Review in vNext+1 (5.0.0) Nov 5, 2020
@samhouts samhouts removed this from In progress in v5.0.1 Nov 5, 2020
@PureWeen PureWeen added this to In progress in v5.0.1 via automation Nov 5, 2020
@PureWeen PureWeen removed this from In Review in vNext+1 (5.0.0) Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v5.0.1
In progress
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.