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

Fixed ScrollY when ItemsSource reloaded or row height changed #12053

Closed
wants to merge 1 commit into from

Conversation

rihadavid
Copy link

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
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis
Copy link
Member

Now that we're so close to the sunsetting of Xamarin.Forms unfortunately we won't be able to take this in anymore, we're really sorry about that. Nevertheless, thank you so much for your time and effort that you have put into this PR.

Please have a look at the evolution of Xamarin.Forms, .NET MAUI. A lot of development has been going on there. Hopefully this issue was already fixed in that codebase. If not, feel free to port this over to there.

Again, thank you so much for being a contributor and Xamarin.Forms user!

@jfversluis jfversluis closed this Apr 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants