Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11859] iOS: 'Fill' TextField incorrectly resizing and repositioning in 'horizontal' layouts

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 2.1.2, Release 2.1.3, Release 2.1.4, Release 3.0.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterMichael McDonald
AssigneeUnknown
Created2012-11-07T18:45:02.000+0000
Updated2018-02-28T20:03:22.000+0000

Description

Problem

Scenario: A fixed-sized Label and a Ti.UI.FILL-width TextArea in a horizontal layout. Bug: When the content of the TextField exceeds the width of the TextField by a certain amount, the TextField element is wrapped to the next line, instead of staying in place. This occurs both in the iPhone simulator via Titanium Studio and on my iPhone.

Test case

var win = Ti.UI.createWindow({
	layout: 'horizontal'
});

win.add(Ti.UI.createLabel({
	width: 120,
	text: 'Enter text:',
	textAlign: Ti.UI.TEXT_ALIGNMENT_RIGHT,
	backgroundColor: '#ddd'
}));

win.add(Ti.UI.createTextField({

	//BUG TextField stretches and repositions with long content
	width: Ti.UI.FILL,

	borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
}));

win.open();

Attachments

FileDateSize
textfield1.png2012-11-07T18:45:02.000+000079776
textfield2.png2012-11-07T18:45:02.000+000089788

Comments

  1. Daniel Sefton 2012-11-26

    Tested and confirmed iOS 5.1, TiSDK 2.1.2 GA, 2.1.4 GA, 3.0.0 CI.
  2. jithinpv 2013-03-26

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) iOS iPhone Simulator: iOS SDK version: 6.0
  3. Lee Morris 2017-05-25

    I have been able to reproduce this issue with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.9.0.201705021158 Ti SDK 6.1.0.v20170519131839 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.7.0_80

JSON Source