unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.04k stars 734 forks source link

[WASM] Problem with UserControl and ignoring settings #6395

Open HavenDV opened 3 years ago

HavenDV commented 3 years ago

Current behavior

2 Differences(In WebAssembly relative to UWP): Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight are ignored

Expected behavior

1

How to reproduce it (as minimally and precisely as possible)

https://github.com/HavenDV/Uno.WASM.TemplateBug https://github.com/HavenDV/Uno.WASM.TemplateBug/commit/b6a4c8ed81b38ced515ba79add7849c00d6191d4

Works on UWP/WinUI

Yes

Environment

Nuget Package:

Nuget Package Version(s):

Affected platform(s): Possible multiple, tested only on WebAssembly

IDE:

Relevant plugins:

jeromelaban commented 3 years ago

Repro archive: Uno.WASM.TemplateBug-master.zip

jeromelaban commented 3 years ago

@carldebilly Are we ignoring MaxWidth/MaxHeight and others when setting the Width/Height properties?

HavenDV commented 3 years ago

This looks like the most difficult and important bug of the series described, because the initial width and height are also ignored, so the parent control has MinWidth = "30" and MinHeight="30". The problem only exists if there is a separate UserControl, and the ContentControl and its derivatives are also used (usually in templates)

carldebilly commented 3 years ago

This could be related to https://github.com/unoplatform/uno/issues/2983 (it's not using shapes at all, so not related).

@jeromelaban we are reusing the same Min/Max/Value logic than Windows. But on Wasm, we're not using the layouter. We'll need to check on Skia...

Youssef1313 commented 1 year ago

Maybe https://github.com/unoplatform/uno/pull/13391 can have an impact?