Bug 26933 - StackLayout gives unexpected width to child label when text is null or less then 1 character
Summary: StackLayout gives unexpected width to child label when text is null or less t...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-02-10 16:55 UTC by John Miller [MSFT]
Modified: 2015-02-11 09:08 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Case (4.66 MB, application/zip)
2015-02-10 16:55 UTC, John Miller [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description John Miller [MSFT] 2015-02-10 16:55:25 UTC
Created attachment 9756 [details]
Test Case

**Overview:**

   When a StackLayout contains children Labels that all have a WidthRequest which totals greater than the total width, the first Label receives the full WidthRequest (no compression) when the Text is `null` or less than or equal to 1 character i.e. "a" or ""

Here is the behavior: http://screencast.com/t/cYYxcdsU7XCa
Notice the first red box in the first row. It receives the full WidthRequest because it has Text of "" or null. The other rows show proper compression because the Labels Text has more than 1 character in it. 

Attached is a sample project.

**Steps to Reproduce:**

   1. Run the attached sample on a simulator (ios or android)

**Expected Results:**

   All Label widths should receive the same compression.

**Build Date & Platform:**

   XF 1.3.2

**Additional Info**

If the WidthRequests of all the Children Labels total less than the total [screen] width, it seems to behave as expected: http://screencast.com/t/cYln1vCJy2
Comment 1 Jason Smith [MSFT] 2015-02-11 09:08:24 UTC
Should be fixed in 1.3.4-pre2