Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17984] TextArea set to FILL not wrapping correctly inside a horizontal layout with another sibling

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-08-22T23:59:02.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.2.0
ComponentsAndroid
LabelsTextArea, layout, size, ui, ui.view, wrap
ReporterTim Kelly
AssigneeJoshua Quick
Created2014-11-05T17:34:55.000+0000
Updated2017-08-22T23:59:23.000+0000

Description

Create a view with horizontal layout. Make two siblings (a view, or anything else), and a TextArea set to FILL. Enter an amount of text into the TextArea that it must wrap but would not have wrapped if the other sibling wasn't there. The text correctly wraps but the TextArea itself does not adjust height. This is a different symptom but may be related to TC-4810. See example below (tried this on an HTC One, for screen size reference):
<Alloy>
	<Window class="container" id="skin" layout="vertical">
		<View layout="vertical" height="Ti.UI.FILL" width="Ti.UI.FILL">
			<View height="Ti.UI.SIZE" width="Ti.UI.FILL" layout="horizontal">
			 	<View height="10dp" width="100dp" backgroundColor="red" />
			 	<TextArea value="Test that won't adjust its height." width="Ti.UI.FILL" backgroundColor="blue" height="Ti.UI.SIZE"/>
			</View>
			<View height="Ti.UI.SIZE" width="Ti.UI.FILL" layout="horizontal">
			 	<View height="10dp" width="100dp" backgroundColor="red" />
				<TextArea value="Test that will adjust height. Would have wrapped." width="Ti.UI.FILL" backgroundColor="blue" height="Ti.UI.SIZE"/>
			</View>
		</View>
	</Window>
</Alloy>

Attachments

FileDateSize
Screenshot_2014-11-05-12-25-40.png2014-11-05T17:34:55.000+000078602

Comments

  1. Shuo Liang 2014-11-06

    Problem can be reproduced on: Titanium SDK 3.4.0 Samsung Galaxy Nexus Android 4.2.2 Here is a simple test code:
       var win = Ti.UI.createWindow({
           fullscreen : true,
           title : 'View Test'
       });
       
       var mainView = Titanium.UI.createView({
           width : Ti.UI.FILL,
           height : Ti.UI.FILL,
           top : '50',
           layout : 'horizontal',
       });
        
       win.add(mainView);
        
       var view1 = Ti.UI.createView({
           width : "100dp",
           backgroundColor : "Red",
           height : "10dp"
       });
       mainView.add(view1);
        
       var textArea = Ti.UI.createTextArea({
           value : 'abcdefghijklmnopqrstuvwxyzabcde',
           backgroundColor : "Blue",
           height : Ti.UI.SIZE,
           width : Ti.UI.FILL,
        
       });
       mainView.add(textArea);
        
       win.open();
       
    N.B. If I change the textArea value longer, like "abcdefghijklmnopqrstuvwxvzabcdefghijklmnopqrstuvwxvz", the wrapping works well.
  2. Abir Mukherjee 2017-08-22

    Passed FR. PR merged. Changes are seen in SDK versions: 6.2.0.v20170822113609 7.0.0.v20170822142802

JSON Source