dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

[9.0 GA, Android] ScrollView starts at the position of first Entry control on the bottom rather than at 0 #25829

Open janne-hmp opened 1 week ago

janne-hmp commented 1 week ago

Description

In .NET MAUI 9.0 GA, Android has a new annoying feature that ScrollView does not start at position 0 but at the position where the content's first Entry control is located on the bottom of the ScrollView. I have a long list of settings on the app's Settings page and it is very confusing if the page is opened in the middle of the settings list rather than at start.

Windows seems to work fine, didn't test iOS. This also worked fine on Android in .NET MAUI 9.0 RC2.

Steps to Reproduce

  1. Download and build GnollHackMAUIEasyBuild for Android by following the given instructions
  2. Start the app and press the Settings button
  3. Settings are opened in the middle of the list with User Name entry being on the bottom

Link to public reproduction project repository

https://github.com/hyvanmielenpelit/GnollHackMAUIEasyBuild

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.0-rc.2.24503.2

Affected platforms

Android

Affected platform versions

Android 14

Did you find any workaround?

Disabling all Entries at start and then enabling them with a 0.5 sec one-off timer seemed to help, but is not very elegant.

Relevant log output

ninachen03 commented 6 days ago

This issue has been verified using Visual Studio 17.13.0 Preview 1.0 (9.0.0 & 9.0.0-rc.2.24503.2). Can repro on Android platform.

mattleibow commented 3 days ago

@ninachen03 did this happen in .NET 8? What about net9 preview6 or 7?

PureWeen commented 3 days ago

@janne-hmp can you provide a simplified sample that reproduces the behavior?

Archive.zip

I did a quick test here with entries in a scrollview and it's not scrolling to the first entry automatically.

ninachen03 commented 3 days ago

@ninachen03 did this happen in .NET 8? What about net9 preview6 or 7?

Sorry, let me add some clarity, This issue is reproduced on 9.0.0-rc.2.24503.2, but not on 9.0.0-rc.1.24453.9 to 9.0.0-preview.1.9973, so it is a regression issue. Image

janne-hmp commented 3 days ago

Hi, the game works just on .NET MAUI 9 (and Xamarin) currently. As Nina Chen mentioned, the problem appears on Android just with 9.0 GA, not with 9.0 RC2. Xamarin works well, too. I cannot check .NET 8 or 7 at the moment, as a meaningful amount of additional work would potentially be needed to add the support for older framework versions.

ninachen03 commented 2 days ago

Hi, the game works just on .NET MAUI 9 (and Xamarin) currently. As Nina Chen mentioned, the problem appears on Android just with 9.0 GA, not with 9.0 RC2. Xamarin works well, too. I cannot check .NET 8 or 7 at the moment, as a meaningful amount of additional work would potentially be needed to add the support for older framework versions.

I used the provided repro on RC2, the problem reappeared. It worked fine on RC1.

janne-hmp commented 2 days ago

Thanks for the clarification, Nina. I probably did not notice the bug in RC2, so good to hear the regression has been found to have occurred already in RC2 instead, and RC1 is the version which works.

PureWeen commented 2 days ago

Fairly sure this was caused by

https://github.com/dotnet/maui/pull/24064