Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7574] MobileWeb: Label does not resize appropriately with height 'auto'

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-02-16T18:02:43.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sSprint 2012-04, Release 2.0.0
ComponentsMobileWeb
Labelsqe-port, stage2
ReporterPatrick Seda
AssigneeBryan Hughes
Created2012-02-07T17:29:45.000+0000
Updated2012-08-27T15:04:44.000+0000

Description

When using a height value of 'auto', a Label does not resize its height. To reproduce, run the following code in MobileWeb. The attached screen captures show the inconsistent behavior between iOS and MobileWeb.
var win = Ti.UI.createWindow();
var label = Ti.UI.createLabel({
	text : 'Appcelerator gets your team up and running on Titanium with a full range of training and certification programs: in-classroom, on-demand, or on-site at your location.',
	width : 150,
	height : 'auto',
	top : 50,
	left : 50,
	backgroundColor : '#ddd'
});
win.add(label);
win.open();

Attachments

FileDateSize
app.js2012-02-15T16:51:34.000+0000497
labelAutoHeight_iOS.tiff2012-02-07T17:29:45.000+000035296
labelAutoHeight_mobileWeb.tiff2012-02-07T17:29:45.000+000012038
Screen Shot 2012-02-09 at 3.35.43 PM.png2012-02-09T15:38:06.000+000031290

Comments

  1. Chris Barber 2012-02-09

    Also related, I noticed that even if the label gets ellisisized, the height of the label grows. See pic attached.
  2. Chris Barber 2012-02-09

       var win = Titanium.UI.createWindow({  
           backgroundColor:'#fff',
           layout: 'vertical'
       });
       
       win.add(Titanium.UI.createLabel({
       	text:"A really long line of text that will surely get cut off, but notice how the it gets an ellipsis and yet the height is about the same as if it was wrapping",
       	backgroundColor: "#9A0707",
       	border: 1,
       	color: "#fff",
       	font:{fontSize:14,fontFamily:'Helvetica Neue'},
       	textAlign:'left',
       	left:5,
       	right: 5,
       	top: 5,
       	height:'auto'
       }));
       
       win.open();
       
  3. Bryan Hughes 2012-02-13

    It turns out that these two issues are unrelated, so I am focusing on Patrick's issue. I think that Chris' issue has been fixed (or rather sidestepped) due to other changes. Patrick: The fix I implemented is not complete, unfortunately. To properly fix it will require TIMOB-7463 and possibly TIMOB-7079, but I am going ahead with the pull request so that we can get the other fixes in sooner rather than later. Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1409
  4. Bryan Hughes 2012-02-16

    Re-opening so we can keep track of the remaining issue.
  5. Bryan Hughes 2012-02-16

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1452 (Same as TIMOB-7463).
  6. Lokesh Choudhary 2012-08-27

    Verified fix on: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120824175712 Chrome 21.0.xx Firefox 14.0.1 Safari 6.0 Android 2.3.6 default browser Iphone 5.0.1 mobile safari

JSON Source