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

ScrollToAsync Not Working on Andrioid #14594

Open
robreno opened this issue Apr 15, 2023 · 5 comments
Open

ScrollToAsync Not Working on Andrioid #14594

robreno opened this issue Apr 15, 2023 · 5 comments
Labels
area-controls-scrollview ScrollView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@robreno
Copy link

robreno commented Apr 15, 2023

Description

The Maui ScrollView method scrollView.ScrollToAsync(label, ScrollToPosition.Start, true) works on Windows but fails on Andoid.

I created a very simple demo here: https://github.com/robreno/ScrollToDemo

It is a simple two page app with a ScrollView with a VerticalStackLayout for this main container and then a series of Labels that have x:Name for scrolling to the Label name. When compiled and deployed on Windows the ScrollToAsync works as expected. On Android the app doesn't scroll to the Label name at all.

I have no idea is this a feature or bug ;-) But it seems this is pretty vanilla functionality that Maui framework should handle. Therefore I would call it a bug. But, if I am doing somethign wrong or need to perhaps write custom handlers and call native Android APIs I am willing to do so, but first need to know if this is a bug.

I tried both scrollView.ScrollToAsync(label, ScrollToPosition.Start, true) and scrollView.ScrollToAsync(labelX, labelY, false). Both these work on Windows, neither of them works on Android.

Steps to Reproduce

  1. Download the demo app, compile and deploy to Windows and then Android.
  2. GitHub Demo App: https://github.com/robreno/ScrollToDemo
  3. The code is pretty simple and self contained.
  4. Watch Video of code: https://youtu.be/Uwy_19Baxes

Link to public reproduction project repository

https://github.com/robreno/ScrollToDemo

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android version 12

Did you find any workaround?

No

Relevant log output

N/A. See demo repo.
@robreno robreno added the t/bug Something isn't working label Apr 15, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Apr 17, 2023
@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Apr 18, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jun 29, 2023
@XamlTest
Copy link

XamlTest commented Jun 29, 2023

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on Android 13.0-API33 with below Project:
ScrollToDemo.zip

Android and Windows scroll to different position:
image
image

@Syed-RI
Copy link

Syed-RI commented Jun 30, 2023

Hmm mine doesnt work on Android or iOS.

Update:

It seems we have to wait for the contents to rendered on the view first before calling ScrollToAsync

@cworth33
Copy link

Yet another bug that is open for over 8 months. At this rate I will NEVER be able to ship my app into production. This is HELL.

@Manish-Pradhan-FP
Copy link

Looks like three's no one actually working on fixing bugs, I think most devs have moved to a different project and the remaining are busy writing blogs or making Youtube videos on how cool MAUI is.

@cat0363
Copy link
Contributor

cat0363 commented Jan 12, 2024

From what I've tried, it works as intended if it's inside the ContentPage's SizeChanged event.
I don't think #19515 is related.

@Eilon Eilon removed the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-scrollview ScrollView platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants