Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8373] iOS: TextFields and TextAreas should have a minimum height/width when they are SIZE and text is empty

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-18T17:05:25.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.1.0, Sprint 2012-07, Release 2.0.1
ComponentsiOS
Labelslayout, parity, qe-testadded, textarea, textfield
ReporterBlain Hamon
AssigneeMax Stepanov
Created2012-03-28T15:40:20.000+0000
Updated2012-04-18T17:05:25.000+0000

Description

Currently, when text widgets are defined such as:
tf1 = Titanium.UI.createTextArea({
	color:'#336699',
	width:250
})
The height will be size to fit, but with no text, this height is 0, thus destroying any functionality. On Android, they use a minimum size. Essentially, if there's no text, we should use a placeholder text, even just a space, to ensure line height show up.

Comments

  1. Max Stepanov 2012-04-04

    Test case:
       var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor:'#fff', layout: 'vertical' });
        
       var tf = Ti.UI.createTextField({ value: 'text field with auto width', borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED, height: 35 });
       var tf2 = Ti.UI.createTextField({ value: 'text field with auto width and height', borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED });
       
       var ta = Ti.UI.createTextArea({ value: 'text area with auto width', borderWidth:2, borderColor:'#bbb', borderRadius:5, height: 70, editable: true });
       var ta2 = Ti.UI.createTextArea({ value: 'text area with auto width and height', borderWidth:2, borderColor:'#bbb', borderRadius:5, editable: true });
        
       win1.add(tf);
       win1.add(tf2);
       win1.add(ta);
       win1.add(ta2);
       win1.open();
       
  2. Max Stepanov 2012-04-04

    PR https://github.com/appcelerator/titanium_mobile/pull/1933 pending.
  3. Vishal Duggal 2012-04-05

    Fixed on master by PR 1933. Waiting for 2_0_X fix before resolving
  4. Vishal Duggal 2012-04-05

    Fixed in 2_0_X by PR 1945
  5. Natalie Huynh 2012-04-06

    Tested with 2.0.1.v20120405211737 with iPhone 4s 5.0.1
  6. Wilson Luu 2012-04-18

    Reopening to update labels.

JSON Source