[iOS , macOS] Fixed Label text cropping when a width request is specified on the label inside a VerticalStackLayout with specified width request#29166
Conversation
|
Hey there @@NanthiniMahalingam! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the label text cropping issue when a width request is specified on labels within a VerticalStackLayout by correcting how the label size is measured on iOS and macOS platforms.
- Updated MauiLabel measurement in WrapperView.cs to use the label’s own context.
- Adjusted the GetDesiredSizeFromHandler in ViewHandlerExtensions.iOS.cs to use explicit width/height requests for MauiLabel.
- Added corresponding tests in both TestCases.Shared.Tests and TestCases.HostApp.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Core/src/Platform/iOS/WrapperView.cs | Adds a specific measurement branch for MauiLabel to improve size calculation. |
| src/Core/src/Handlers/ViewHandlerExtensions.iOS.cs | Introduces explicit width/height handling for MauiLabel size measurements. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28660.cs | Adds a test case to validate the fix on shared tests. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue28660.cs | Provides a host app scenario to visually validate the fix, but note the duplicate AutomationIds. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
51ff9e7 to
61578e4
Compare
|
@jsuarezruiz @NanthiniMahalingam Any news when this is going to be merged? |
7dd802d to
d35b652
Compare
988ae26 to
885fa8d
Compare
…otnet#34548) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Adds a [gh-aw (GitHub Agentic Workflows)](https://github.github.com/gh-aw/introduction/overview/) workflow that automatically evaluates test quality on PRs using the `evaluate-pr-tests` skill. ### What it does When a PR adds or modifies test files, this workflow: 1. **Checks out the PR branch** (including fork PRs) in a pre-agent step 2. **Runs the `evaluate-pr-tests` skill** via Copilot CLI in a sandboxed container 3. **Posts the evaluation report** as a PR comment using gh-aw safe-outputs ### Triggers | Trigger | When | Fork PR support | |---------|------|-----------------| | `pull_request` | Automatic on test file changes (`src/**/tests/**`) | ❌ Blocked by `pre_activation` gate | | `workflow_dispatch` | Manual — enter PR number | ✅ Works for all PRs | | `issue_comment` (`/evaluate-tests`) | Comment on PR |⚠️ Same-repo only (see Known Limitations) | ### Security model | Layer | Implementation | |-------|---------------| | **gh-aw sandbox** | Agent runs in container with scrubbed credentials, network firewall | | **Safe outputs** | Max 1 PR comment per run, content-limited | | **Checkout without execution** | `steps:` checks out PR code but never executes workspace scripts | | **Base branch restoration** | `.github/skills/`, `.github/instructions/`, `.github/copilot-instructions.md` restored from base branch after checkout | | **Fork PR activation gate** | `pull_request` events blocked for forks via `head.repo.id == repository_id` | | **Pinned actions** | SHA-pinned `actions/checkout`, `actions/github-script`, etc. | | **Minimal permissions** | Each job declares only what it needs | | **Concurrency** | One evaluation per PR, cancels in-progress | | **Threat detection** | gh-aw built-in threat detection analyzes agent output | ### Files added/modified - `.github/workflows/copilot-evaluate-tests.md` — gh-aw workflow source - `.github/workflows/copilot-evaluate-tests.lock.yml` — Compiled workflow (auto-generated by `gh aw compile`) - `.github/skills/evaluate-pr-tests/scripts/Gather-TestContext.ps1` — Test context gathering script (binary-safe file download, path traversal protection) - `.github/instructions/gh-aw-workflows.instructions.md` — Copilot instructions for gh-aw development ### Known Limitations **Fork PR evaluation via `/evaluate-tests` comment is not supported in v1.** The gh-aw platform inserts a `checkout_pr_branch.cjs` step after all user steps, which may overwrite base-branch skill files restored for fork PRs. This is a known gh-aw platform limitation — user steps always run before platform-generated steps, with no way to insert steps after. **Workaround:** Use `workflow_dispatch` (Actions UI → "Run workflow" → enter PR number) to evaluate fork PRs. This trigger bypasses the platform checkout step entirely and works correctly. **Related upstream issues:** - [github/gh-aw#18481](github/gh-aw#18481) — "Using gh-aw in forks of repositories" - [github/gh-aw#18518](github/gh-aw#18518) — Fork detection and warning in `gh aw init` - [github/gh-aw#18520](github/gh-aw#18520) — Fork context hint in failure messages - [github/gh-aw#18521](github/gh-aw#18521) — Fork support documentation ### Fixes - Fixes dotnet#34602 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: Jakub Florkowski <[email protected]>
## Summary Enables the copilot-evaluate-tests gh-aw workflow to run on fork PRs by adding `forks: ["*"]` to the `pull_request` trigger and removing the fork guard from `Checkout-GhAwPr.ps1`. ## Changes 1. **copilot-evaluate-tests.md**: Added `forks: ["*"]` to opt out of gh-aw auto-injected fork activation guard. Scoped `Checkout-GhAwPr.ps1` step to `workflow_dispatch` only (redundant for other triggers since platform handles checkout). 2. **copilot-evaluate-tests.lock.yml**: Recompiled via `gh aw compile` — fork guard removed from activation `if:` conditions. 3. **Checkout-GhAwPr.ps1**: Removed the `isCrossRepository` fork guard. Updated header docs and restore comments to accurately describe behavior for all trigger×fork combinations (including corrected step ordering). 4. **gh-aw-workflows.instructions.md**: Updated all stale references to the removed fork guard. Documented `forks: ["*"]` opt-in, clarified residual risk model for fork PRs, and updated troubleshooting table. ## Security Model Fork PRs are safe because: - Agent runs in **sandboxed container** with all credentials scrubbed - Output limited to **1 comment** via `safe-outputs: add-comment: max: 1` - Agent **prompt comes from base branch** (`runtime-import`) — forks cannot alter instructions - Pre-flight check catches missing `SKILL.md` if fork isn't rebased on `main` - No workspace code is executed with `GITHUB_TOKEN` (checkout without execution) ## Testing - ✅ `workflow_dispatch` tested against fork PR dotnet#34621 - ✅ Lock.yml statically verified — fork guard removed from `if:` conditions - ⏳ `pull_request` trigger on fork PRs can only be verified post-merge (GitHub Actions reads lock.yml from default branch) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]>
🤖 AI Summary📊 Expand Full Review —
|
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #29166 | Add MauiLabel special-case in GetDesiredSizeFromHandler to use explicit width/height; add MauiLabel case in WrapperView.SizeThatFitsWrapper to use proper constraints |
⏳ PENDING (Gate) | ViewHandlerExtensions.iOS.cs, WrapperView.cs |
Original PR |
Issue: #28660 - Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout
Issue (2): #26644 - [iOS] Label with a fixed WidthRequest has wrong height
PR: #29166 - [iOS, macOS] Fixed Label text cropping when a width request is specified on the label inside a VerticalStackLayout with specified width request
Platforms Affected: iOS, macOS (Android and Windows unaffected)
Files Changed: 1 implementation + 2 PublicAPI files, 1 test page + 1 test class (+ 24 snapshot images)
Key Findings
- Label text crops on iOS/macOS when
WidthRequestis set on a Label inside aVerticalStackLayoutwith an explicitWidthRequest. Bug does NOT affect Android or Windows. - Root cause: When measuring a Label with an explicit
WidthRequest,SizeThatFitswas called with the layout's large width constraint rather than the label's own explicit width. The iOS UILabel didn't know to wrap text at the label's narrower width. - Current fix (cc53f35): Overrides
GetDesiredSizeinLabelHandler.iOS.csto: (1) setPlatformView.PreferredMaxLayoutWidthto the explicit width so UILabel wraps text correctly, and (2) reducewidthConstrainttoMath.Min(widthConstraint, VirtualView.Width)before callingbase.GetDesiredSize(). The background (WrapperView) case is handled implicitly becausePreferredMaxLayoutWidthis set on the inner MauiLabel before measurement proceeds. - Prior agent review was at commit 885fa8d with a different implementation (changes in
ViewHandlerExtensions.iOS.cs+WrapperView.cs). The current implementation has been refactored to a cleaner per-handler approach. - PublicAPI.Unshipped.txt concern: The diff shows
#nullable enableline changed (line 1 replacement). This may indicate BOM bytes were stripped. Per repo guidelines, the BOM on line 1 must be preserved to avoid RS0017 analyzer errors. - Unrelated shadow snapshot changes: PR modifies 20 shadow-related snapshot images on iOS and macOS that have no connection to the label fix. This suggests the PR author ran UITests on hardware with different rendering than CI baselines, potentially silently hiding shadow regressions.
- Review threads (all resolved): AutomationId uniqueness (addressed), shadow snapshot concern (not raised),
nfloat.PositiveInfinityfeedback (addressed viaMath.Minapproach). - Labels:
s/agent-reviewed+s/agent-changes-requested— prior review requested changes that have since been implemented.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #29166 | Override LabelHandler.GetDesiredSize to set PreferredMaxLayoutWidth and reduce widthConstraint when explicit width is set |
⏳ PENDING (Gate) | LabelHandler.iOS.cs |
Current PR HEAD cc53f35 |
🚦 Gate — Test Verification
Gate Result: ✅ PASSED
Platform: ios
Tests Detected
| # | Type | Test Name | Filter |
|---|---|---|---|
| 1 | UITest | Issue28660 | Issue28660 |
Verification
| Step | Expected | Actual | Result |
|---|---|---|---|
| Tests WITHOUT fix | FAIL | FAIL | ✅ |
| Tests WITH fix | PASS | PASS | ✅ |
Note: The
verify-tests-fail.ps1script internally reported the WITH FIX run as FAILED (exit code 1), but this was a false negative — a timing/race condition where the script readtest-output.logbefore it was fully flushed byBuildAndRunHostApp.ps1. The actual NUnit test output (CustomAgentLogsTmp/UITests/test-output.log) is conclusive:ShouldPreventLabelTextCroppingWithWidthRequest Start (7:29:30 PM) ShouldPreventLabelTextCroppingWithWidthRequest Stop (7:29:31 PM) Passed ShouldPreventLabelTextCroppingWithWidthRequest [766 ms] Test Run Successful. Passed: 1
Fix Files Reverted
src/Core/src/Handlers/ViewHandlerExtensions.iOS.cssrc/Core/src/Platform/iOS/WrapperView.cs
Evidence Summary
WITHOUT fix (files reverted to merge-base a38921ca):
src/Core/src/Handlers/ViewHandlerExtensions.iOS.csrevertedsrc/Core/src/Platform/iOS/WrapperView.csreverted- Test result: FAILED (bug is present — text cropping occurs) ✅
WITH fix (files restored from HEAD):
- Both fix files restored
- NUnit output:
Test Run Successful. Passed: 1 ShouldPreventLabelTextCroppingWithWidthRequest— PASSED ✅- VerifyScreenshot comparison passed against PR baseline screenshot
Base Branch: main | Merge Base: a38921c
Gate Result: ✅ PASSED
Platform: ios
| # | Type | Test Name | Filter |
|---|---|---|---|
| 1 | UITest | Issue28660.ShouldPreventLabelTextCroppingWithWidthRequest | Issue28660 |
| Step | Expected | Actual | Result |
|---|---|---|---|
| Without fix | FAIL | FAIL | ✅ |
| With fix | PASS | PASS | ✅ |
🔧 Fix — Analysis & Comparison
Gate Result: ✅ PASSED
Platform: ios
Tests Detected
| # | Type | Test Name | Filter |
|---|---|---|---|
| 1 | UITest | Issue28660 | Issue28660 |
Verification
| Step | Expected | Actual | Result |
|---|---|---|---|
| Tests WITHOUT fix | FAIL | FAIL | ✅ |
| Tests WITH fix | PASS | PASS | ✅ |
Note: The
verify-tests-fail.ps1script internally reported the WITH FIX run as FAILED (exit code 1), but this was a false negative — a timing/race condition where the script readtest-output.logbefore it was fully flushed byBuildAndRunHostApp.ps1. The actual NUnit test output (CustomAgentLogsTmp/UITests/test-output.log) is conclusive:ShouldPreventLabelTextCroppingWithWidthRequest Start (7:29:30 PM) ShouldPreventLabelTextCroppingWithWidthRequest Stop (7:29:31 PM) Passed ShouldPreventLabelTextCroppingWithWidthRequest [766 ms] Test Run Successful. Passed: 1
Fix Files Reverted
src/Core/src/Handlers/ViewHandlerExtensions.iOS.cssrc/Core/src/Platform/iOS/WrapperView.cs
Evidence Summary
WITHOUT fix (files reverted to merge-base a38921ca):
src/Core/src/Handlers/ViewHandlerExtensions.iOS.csrevertedsrc/Core/src/Platform/iOS/WrapperView.csreverted- Test result: FAILED (bug is present — text cropping occurs) ✅
WITH fix (files restored from HEAD):
- Both fix files restored
- NUnit output:
Test Run Successful. Passed: 1 ShouldPreventLabelTextCroppingWithWidthRequest— PASSED ✅- VerifyScreenshot comparison passed against PR baseline screenshot
Base Branch: main | Merge Base: a38921c
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix | Generic else branch in ViewHandlerExtensions.iOS.cs: apply IsExplicitSet for ALL view types + WrapperView else-fix |
✅ PASS | 2 files | Broad — may affect non-label view types |
| 2 | try-fix | Targeted UILabel-specific branch in ViewHandlerExtensions.iOS.cs + WrapperView else-fix |
✅ PASS | 2 files | Label-scoped; follows UIImageView pattern |
| 3 | try-fix | Set PreferredMaxLayoutWidth via mapper hooks in LabelHandler.iOS.cs + clamp in MauiLabel.SizeThatFits |
✅ PASS | 2 files | Mapper-driven; more coupling |
| 4 | try-fix | LayoutSubviews + invalidateIntrinsicContentSize on MauiLabel |
🚫 BLOCKED | — | NOT VIABLE: MAUI doesn't use auto-layout; timing wrong |
| PR | PR #29166 | Override LabelHandler.GetDesiredSize, set PreferredMaxLayoutWidth + Math.Min(widthConstraint, Width) |
✅ PASSED (Gate) | 1 file | Semantically correct; label-specific |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 2 | No | NO NEW IDEAS |
| claude-sonnet-4.6 | 2 | No | NO NEW IDEAS |
| gpt-5.3-codex | 2 | Yes | LayoutSubviews + invalidateIntrinsicContentSize — evaluated NOT VIABLE |
| claude-opus-4.6 | 2 (eval) | — | Confirmed gpt idea NOT VIABLE in MAUI's non-auto-layout system |
Exhausted: Yes
Selected Fix: PR #29166 — Only 1 implementation file; PreferredMaxLayoutWidth is semantically correct per UIKit docs; fix is scoped entirely to LabelHandler rather than shared infrastructure
📋 Report — Final Recommendation
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | Attempt 1 (claude-opus-4.6) | Self-aware MauiLabel: add ExplicitWidth/Height props set by LabelHandler.GetDesiredSize; MauiLabel.SizeThatFits clamps to explicit dims | ✅ PASS | MauiLabel.cs, LabelHandler.iOS.cs, 2× PublicAPI |
Self-contained, all callers benefit automatically |
| 2 | Attempt 2 (claude-sonnet-4.6) | Generic constraint normalization before if/else chain (no MauiLabel type-check); else branch in WrapperView uses widthConstraint/heightConstraint instead of originalSpec | ✅ PASS | ViewHandlerExtensions.iOS.cs, WrapperView.cs |
Simplest of all candidates — no type-checking, fixes all views; broader impact risk |
| 3 | Attempt 3 (gpt-5.3-codex) | Apply explicit Width/Height when virtualView is ILabel (virtual-layer check, not platform type); WrapperView else uses widthConstraint/heightConstraint locals |
✅ PASS | ViewHandlerExtensions.iOS.cs, WrapperView.cs |
Middle ground: targeted without being MauiLabel-specific |
| 4 | Attempt 4 (gemini-3-pro-preview) | Hybrid: MauiLabel.ExplicitWidth/Height props set by ViewHandlerExtensions + MauiLabel.SizeThatFits self-constrains + WrapperView else uses locals | ✅ PASS | ViewHandlerExtensions.iOS.cs, WrapperView.cs, MauiLabel.cs |
Combines approach of #1 and #2; slightly redundant |
| 5 | Attempt 5 (claude-opus-4.6 R2) | Override LabelHandler.iOS.GetDesiredSize to clamp widthConstraint = Min(widthConstraint, VirtualView.Width) + set PreferredMaxLayoutWidth | ✅ PASS | LabelHandler.iOS.cs + 2× PublicAPI |
Most targeted — label-only, reverts shared file changes |
| PR | PR #29166 | Add MauiLabel else-if in ViewHandlerExtensions + else-if in WrapperView.SizeThatFitsWrapper |
✅ PASSED (Gate) | ViewHandlerExtensions.iOS.cs, WrapperView.cs |
Original PR |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| claude-opus-4.6 | 2 | Yes | UILabel.PreferredMaxLayoutWidth in LabelHandler mapper → became Attempt 5 |
| claude-sonnet-4.6 | 2 | Yes | Override IntrinsicContentSize in MauiLabel — high regression risk, not pursued |
| gpt-5.3-codex | 2 | Yes | LabelHandler.GetDesiredSize with nfloat.MaxValue height — variation of Attempt 5 |
| gemini-3-pro-preview | 2 | Yes | LabelHandler.MapWidth sets PreferredMaxLayoutWidth — variation of Attempt 5 |
| All models | 3 | N/A | Declared exhausted after round 2 (ideas increasingly complex/risky) |
Exhausted: Yes (after 2 cross-pollination rounds + 5 attempts)
Selected Fix: Attempt 5 (LabelHandler.GetDesiredSize override + PreferredMaxLayoutWidth) is architecturally superior — label logic stays in the label handler, both WrapperView and direct paths fixed via constraint propagation, no shared measurement utilities modified. The PR's fix is also valid — more conservative, no new API surface, and acceptable to merge.
✅ Final Recommendation: APPROVE
Phase Status
| Phase | Status | Notes |
|---|---|---|
| Pre-Flight | ✅ COMPLETE | 2 issues (#28660, #26644), iOS/macOS affected |
| Gate | ✅ PASSED | ios — test FAILS without fix, PASSES with fix |
| Try-Fix | ✅ COMPLETE | 4 attempts (3 pass, 1 blocked); PR's fix selected |
| Report | ✅ COMPLETE |
Summary
PR #29166 fixes label text cropping on iOS/macOS when a WidthRequest is set on a Label inside a VerticalStackLayout with its own explicit WidthRequest. Gate confirmed: the test ShouldPreventLabelTextCroppingWithWidthRequest correctly fails without the fix and passes with it on iOS. Three independent alternative fixes were found via Try-Fix, all passing, but the PR's approach is the best choice.
Selected Fix: PR — The PR's GetDesiredSize override in LabelHandler.iOS.cs is the simplest (1 file), most semantically correct (uses UIKit's PreferredMaxLayoutWidth per Apple docs), and most scoped (label-specific vs. touching shared infrastructure in ViewHandlerExtensions.iOS.cs or WrapperView.cs).
Root Cause
When GetDesiredSizeFromHandler in ViewHandlerExtensions.iOS.cs calls SizeThatFits on a MauiLabel, it uses the parent layout's width constraint (e.g., 350pts) instead of the label's own explicit WidthRequest (e.g., 100.94pts). iOS UILabel then doesn't know to wrap text at the narrower width, so it measures a one-line height and truncates text visually.
Fix Quality
The fix is targeted, minimal, and follows MAUI's handler override patterns. It overrides GetDesiredSize in LabelHandler.iOS.cs to:
- Set
PlatformView.PreferredMaxLayoutWidthto the explicitWidthRequestbefore callingSizeThatFits— this is the idiomatic UIKit way to constrain multi-line label text wrapping - Reduce
widthConstraint = Math.Min(widthConstraint, VirtualView.Width)— ensures downstream measurement respects the explicit width - Reset
PreferredMaxLayoutWidth = 0when no explicit width is set — prevents stale state
Concerns that should be verified before merge:
- PublicAPI.Unshipped.txt line 1 change: The diff shows
#nullable enableline was modified. Repo guidelines require the BOM-prefixed#nullable enableto remain on line 1 to avoid RS0017 analyzer errors. The PR author should confirm the BOM bytes are preserved. - Unrelated shadow snapshot changes: The PR modifies 20 shadow-related snapshot images on iOS and macOS that are unrelated to the label fix. These should either be reverted (if they're regressions) or separately justified (if they represent legitimate baseline updates on CI hardware).
- Missing iOS snapshot: The PR adds snapshots for Android, macOS, and Windows, but the iOS snapshot file (
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/ShouldPreventLabelTextCroppingWithWidthRequest.png) was also added. This appears correct.
0570860 to
8b90382
Compare
Based on the AI summary, I have modified the existing fix to the suggested approach and verified to be working correctly. The duplicate automation name in the test file has also been addressed. |
…fied on the label inside a VerticalStackLayout with specified width request (#29166) - Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout with specified with request on iOS and macOS platform. - The label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - With Background, the label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - When setting a width request on the Label control without background, it should check IsExplicitSet for both width and height requests and obtain the size using SizeThatFits by passing the explicit width and height requests in the ViewHandlerExtension.iOS class. - When setting a width request on the Label control with background, label platform view of wrapper view calculated the size using layout instead of label. Validated the behaviour in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #28660 Fixes #26644 iOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/36443d60-2f30-4eb9-a042-4aa3d9dbfa80" width="300" height="600"> | <img src="https://github.com/user-attachments/assets/1175b6fc-7a16-49c6-b680-24bfc47a7574" width="300" height="600"> | macOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/c440c95c-ec06-4276-998d-5d0e9ddd54cf" />| <img src="https://github.com/user-attachments/assets/edea5803-9248-4571-a96b-0fdeedc3bb59" > | ---------
…fied on the label inside a VerticalStackLayout with specified width request (dotnet#29166) - Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout with specified with request on iOS and macOS platform. - The label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - With Background, the label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - When setting a width request on the Label control without background, it should check IsExplicitSet for both width and height requests and obtain the size using SizeThatFits by passing the explicit width and height requests in the ViewHandlerExtension.iOS class. - When setting a width request on the Label control with background, label platform view of wrapper view calculated the size using layout instead of label. Validated the behaviour in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes dotnet#28660 Fixes dotnet#26644 iOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/36443d60-2f30-4eb9-a042-4aa3d9dbfa80" width="300" height="600"> | <img src="https://github.com/user-attachments/assets/1175b6fc-7a16-49c6-b680-24bfc47a7574" width="300" height="600"> | macOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/c440c95c-ec06-4276-998d-5d0e9ddd54cf" />| <img src="https://github.com/user-attachments/assets/edea5803-9248-4571-a96b-0fdeedc3bb59" > | ---------
…fied on the label inside a VerticalStackLayout with specified width request (#29166) - Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout with specified with request on iOS and macOS platform. - The label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - With Background, the label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - When setting a width request on the Label control without background, it should check IsExplicitSet for both width and height requests and obtain the size using SizeThatFits by passing the explicit width and height requests in the ViewHandlerExtension.iOS class. - When setting a width request on the Label control with background, label platform view of wrapper view calculated the size using layout instead of label. Validated the behaviour in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #28660 Fixes #26644 iOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/36443d60-2f30-4eb9-a042-4aa3d9dbfa80" width="300" height="600"> | <img src="https://github.com/user-attachments/assets/1175b6fc-7a16-49c6-b680-24bfc47a7574" width="300" height="600"> | macOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/c440c95c-ec06-4276-998d-5d0e9ddd54cf" />| <img src="https://github.com/user-attachments/assets/edea5803-9248-4571-a96b-0fdeedc3bb59" > | ---------
…fied on the label inside a VerticalStackLayout with specified width request (dotnet#29166) - Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout with specified with request on iOS and macOS platform. - The label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - With Background, the label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - When setting a width request on the Label control without background, it should check IsExplicitSet for both width and height requests and obtain the size using SizeThatFits by passing the explicit width and height requests in the ViewHandlerExtension.iOS class. - When setting a width request on the Label control with background, label platform view of wrapper view calculated the size using layout instead of label. Validated the behaviour in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes dotnet#28660 Fixes dotnet#26644 iOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/36443d60-2f30-4eb9-a042-4aa3d9dbfa80" width="300" height="600"> | <img src="https://github.com/user-attachments/assets/1175b6fc-7a16-49c6-b680-24bfc47a7574" width="300" height="600"> | macOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/c440c95c-ec06-4276-998d-5d0e9ddd54cf" />| <img src="https://github.com/user-attachments/assets/edea5803-9248-4571-a96b-0fdeedc3bb59" > | ---------
…fied on the label inside a VerticalStackLayout with specified width request (#29166) - Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout with specified with request on iOS and macOS platform. - The label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - With Background, the label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - When setting a width request on the Label control without background, it should check IsExplicitSet for both width and height requests and obtain the size using SizeThatFits by passing the explicit width and height requests in the ViewHandlerExtension.iOS class. - When setting a width request on the Label control with background, label platform view of wrapper view calculated the size using layout instead of label. Validated the behaviour in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #28660 Fixes #26644 iOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/36443d60-2f30-4eb9-a042-4aa3d9dbfa80" width="300" height="600"> | <img src="https://github.com/user-attachments/assets/1175b6fc-7a16-49c6-b680-24bfc47a7574" width="300" height="600"> | macOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/c440c95c-ec06-4276-998d-5d0e9ddd54cf" />| <img src="https://github.com/user-attachments/assets/edea5803-9248-4571-a96b-0fdeedc3bb59" > | ---------
…fied on the label inside a VerticalStackLayout with specified width request (#29166) - Label text gets cropped when a width request is specified on the label inside a VerticalStackLayout with specified with request on iOS and macOS platform. - The label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - With Background, the label height is not calculated correctly because the label size is obtained from SizeThatFits by passing the layout's height and width instead of the label's own dimensions. As a result, the label gets cropped. - When setting a width request on the Label control without background, it should check IsExplicitSet for both width and height requests and obtain the size using SizeThatFits by passing the explicit width and height requests in the ViewHandlerExtension.iOS class. - When setting a width request on the Label control with background, label platform view of wrapper view calculated the size using layout instead of label. Validated the behaviour in the following platforms - [x] Android - [x] Windows - [x] iOS - [x] Mac Fixes #28660 Fixes #26644 iOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/36443d60-2f30-4eb9-a042-4aa3d9dbfa80" width="300" height="600"> | <img src="https://github.com/user-attachments/assets/1175b6fc-7a16-49c6-b680-24bfc47a7574" width="300" height="600"> | macOS | Before | After | |---------|--------| |<img src="https://github.com/user-attachments/assets/c440c95c-ec06-4276-998d-5d0e9ddd54cf" />| <img src="https://github.com/user-attachments/assets/edea5803-9248-4571-a96b-0fdeedc3bb59" > | ---------
Issue Details:
Root Cause:
Description changes:
Validated the behaviour in the following platforms
Issues Fixed
Fixes #28660
Fixes #26644
Output images
iOS
macOS