ScrollView.ScrollToAsync doesn't work when called from Page.OnAppearing #26781
Labels
area-controls-scrollview
ScrollView
migration-compatibility
Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert
platform/android 🤖
platform/iOS 🍎
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
I have a page that runs ScrollToAsync on a ScrollView in OnAppearing, but that doesn't appear to do anything, the control passed in still remains not seen at the bottom of the screen.
Steps to Reproduce
See the app in the linked repository:
Run the app.
You will see a button (ButtonTop) at the top of the screen with a caption "Jump to Bottom" Lots of labels filling up the rest of the screen, and if you scroll down, you'll see another button called BottomButton with text "Jump to Top".
If you examine the code, you'll see that in OnAppearing, when it runs for the first time, it should scroll to BottomButton, ensuring it is visible. That code executes, but does not seem to have any effect on the display.
Link to public reproduction project repository
https://github.com/Mark-NC001/ScrollToControl
Version with bug
9.0.21 SR2.1
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
No response
Affected platforms
Windows, Android, I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: