This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixed ScrollY when ItemsSource reloaded or row height changed #12047
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* [Build] Add auto-format daily action * Update dotnet-format-daily.yml
* Added LineBreakMode in the Button and TestAttributes * Added LineBreakMode implementation on Android platform * Added Issue into the Controls project * Removed unused method * Added UWP support for LineBreakMode * Implemented LineBreakMode on iOS * Update Xamarin.Forms.Core/Button.cs Co-authored-by: Stephane Delcroix <[email protected]> Co-authored-by: Stephane Delcroix <[email protected]> Co-authored-by: Rui Marinho <[email protected]> fixes xamarin#3106
Fixes xamarin#8305 and xamarin#9370 and another bug that has not been reported - changing height of the first row also creates incorrect ScrollY value. Not 100% sure if there can't be any other situation when the scroll fails to be tracked, 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 were 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.
samhouts
added
Core
p/iOS 🍎
p/Android
p/UWP
p/WPF
a/listview
Problems with the ListView/TableView
good first issue
hackathon
t/bug 🐛
labels
Sep 7, 2020
Hey @rihadavid thanks for your contribution! Try to rebase your branch against the 5.0.0. If you need any help, please let me know |
I did that, in the web GUI, but it didn't change the pull request. I am not friend with git commands, so it might be easier to close this and create a new PR, right? |
@rihadavid if you don't want to try you can open a new. Be aware to create a branch based on the 5.0 branch |
Closing due to bad branching, moved to #12053 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
a/listview
Problems with the ListView/TableView
Core
good first issue
hackathon
p/Android
p/iOS 🍎
p/UWP
p/WPF
t/bug 🐛
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
EDIT: seems like I did some bad branching here, sorry, my first PR here 😁 this was supposed to be a single file commit (Xamarin.Forms.Platform.Android/Renderers/ListViewRenderer.cs). Can someone make it right?
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
to0
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
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
to0
doesn't create any side effects in different situations.PR Checklist