[TIMOB-8373] iOS: TextFields and TextAreas should have a minimum height/width when they are SIZE and text is empty
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-04-18T17:05:25.000+0000 |
| Affected Version/s | Release 2.0.0 |
| Fix Version/s | Release 2.1.0, Sprint 2012-07, Release 2.0.1 |
| Components | iOS |
| Labels | layout, parity, qe-testadded, textarea, textfield |
| Reporter | Blain Hamon |
| Assignee | Max Stepanov |
| Created | 2012-03-28T15:40:20.000+0000 |
| Updated | 2012-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.
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();PR https://github.com/appcelerator/titanium_mobile/pull/1933 pending.
Fixed on master by PR 1933. Waiting for 2_0_X fix before resolving
Fixed in 2_0_X by PR 1945
Tested with 2.0.1.v20120405211737 with iPhone 4s 5.0.1
Reopening to update labels.