maui
maui copied to clipboard
Fixed Size not calculated properly when invoking UseMauiCompatibility method in MauiProgram
Root Cause
The DesiredSize of the label is set to 0, making the label invisible. In the GetDesiredSize method of the VisualElementRenderer, a size of 0 is returned because the control is null, even though a child element is present.
Description of Change
Measuring the child elements, if they exist, even though the control is null, will resolve this issue.
Validated the behaviour in the following platforms
- [x] Android
- [x] Windows
- [ ] iOS
- [ ] Mac
Issues Fixed
Fixes #10238
Output
Windows
Before
After
Hey there @NirmalKumarYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/backport to release/9.0.1xx
Started backporting to release/9.0.1xx: https://github.com/dotnet/maui/actions/runs/11350449414
@PureWeen backporting to release/9.0.1xx failed, the patch most likely resulted in conflicts:
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fixed - 10238 - Size not calculated properly when invoking UseMauiCompatibility method in MauiProgram
Applying: Modified code changes
Applying: Fixed - 10238 - Size not calculated properly when invoking UseMauiCompatibility method in MauiProgram
Using index info to reconstruct a base tree...
M src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
CONFLICT (content): Merge conflict in src/Compatibility/Core/src/Windows/VisualElementRenderer.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0003 Fixed - 10238 - Size not calculated properly when invoking UseMauiCompatibility method in MauiProgram
Error: The process '/usr/bin/git' failed with exit code 128
Please backport manually!
@PureWeen an error occurred while backporting to release/9.0.1xx, please check the run log for details!
Error: git am failed, most likely due to a merge conflict.
A PR targeting GA has been created. Please refer to the link #25494