unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.78k stars 706 forks source link

MVVM lifecycle discrepancy #18228

Open MartinZikmund opened 1 day ago

MartinZikmund commented 1 day ago

UnoTextBoxBugDemo.zip I have created a simple reproduction case for the TextBoxbug caused by this.

Enter a name and then go to second page

image

On the second page, the text overlaps the header. I need to "move" the mouse over the TextBox to fix it!image

image

This will happen with all the TextBoxes. Try running it com Desktop or WebAssembly.

If you run it with WinAppSdk, the second screen will not open and will crash with an error.

image

Originally posted by @wagenheimer in https://github.com/unoplatform/uno/discussions/18222#discussioncomment-10671931

wagenheimer commented 1 day ago

Using the same repro example, we encountered the same TextBox bug on Android, along with an additional error: "System.InvalidOperationException: 'The dependency property system should not be accessed from a non-UI thread.'"

Updating the ListComboBox on the UI thread resolved the crash issue; however, the TextBox bug continues to persist.

kazo0 commented 17 hours ago

Looks to be similar to https://github.com/unoplatform/Uno.Themes/issues/1472

We will double check that latest stable Uno Material fixes this issue as well

kazo0 commented 16 hours ago

@MartinZikmund Would you be able to re-upload the sample .zip but zip the root folder of the solution? This .zip is missing the .sln and the global.json/directory.packages.props/directory.props/etc.

wagenheimer commented 16 hours ago

@kazo0 Here is it! Sorry for the missing files. UnoTextBoxBugDemo.zip

Kunal22shah commented 16 hours ago

@wagenheimer This has been fixed in the latest packages for Uno.Material.WinUI. You should be able to use the latest stable packages for Material by placing this in your .csproj

<PropertyGroup>
    <UnoThemesVersion>5.1.9</UnoThemesVersion>
</PropertyGroup>

There should soon be a new Uno.Sdk 5.3.x version published that will include the latest Uno Material stable version

I tested the same with your Demo app

wagenheimer commented 12 hours ago

It appears to be fixed now. Thank you!