Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9736] iOS: Text Area in Scroll View in Modal Window Goes offscreen on focus

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-11-01T20:12:21.000+0000
Affected Version/sRelease 2.0.2, Release 2.1.0
Fix Version/sSprint 2012-13 API, Release 3.0.0
ComponentsiOS
Labelsapi, ios6, module_textarea, qe-ios214, qe-testadded
ReporterCarter Lathrop
AssigneeSabil Rahim
Created2012-06-22T16:19:29.000+0000
Updated2015-10-12T11:44:58.000+0000

Description

Description

When text area inside scroll view, inside modal window, is focused, the scroll view jumps up out of view then settles back down to the correct position above the keyboard. If text is entered the text area does not settle back down above the keyboard. It stays up and out of view. This only happens on device and works fine in simulator.

Test Case


var win = Ti.UI.createWindow({
	backgroundColor: '#ccc'
});

var btn = Ti.UI.createButton({
	width: Ti.UI.SIZE,
	height: Ti.UI.SIZE,
	title: 'Click me!'
});

win.add(btn);
 
btn.addEventListener('click', function(e) {

	var w = Ti.UI.createWindow({
		backgroundColor : 'stripped'
	});

	var scrollView = Ti.UI.createScrollView({
		contentHeight: 1000,
		width: Ti.UI.FILL,
		height: Ti.UI.FILL
	});

	var label = Ti.UI.createLabel({
		text : 'Scroll Down',
		height : Ti.UI.SIZE,
		width : Ti.UI.FILL,
		textAlign : 'center',
		top: 10
	});

	var textArea = Ti.UI.createTextArea({
		left:10,
		right:10,
		bottom: 150,
		height: 100,
	});
	var btn = Titanium.UI.createButton({
		title : 'Close',
		width: Ti.UI.SIZE,
		height: Ti.UI.SIZE,
		bottom: 50
	});


	scrollView.add(label);
	scrollView.add(textArea);
	scrollView.add(btn);

	textArea.addEventListener('return', function() {
		textArea.blur();
	});
	
	w.add(scrollView);
	w.orientationModes = [
	Titanium.UI.PORTRAIT,
	Titanium.UI.LANDSCAPE_LEFT,
	Titanium.UI.LANDSCAPE_RIGHT
];
	w.open({modal : true});

});

win.open();

To Reproduce

1. Copy and paste this code into your app.js 2. Run the app on the device 3. Click on the button and it will open a modal window 4. Scroll down and tap in the text area 5. Type in the text area

Comments

  1. Shyam Bhadauria 2012-08-09

    Re-opening to edit label
  2. Satyam Sekhri 2012-08-23

    Occurs on: Titanium Studio: 2.1.2.201208201549 Titanium SDK: 2.1.2.v20120821160113 Device: iPad3 (v5.1) Fixed with SDK: 2.2.0.v20120808154112
  3. Naga harish M 2012-11-01

    I tried with iOS 6 in iPhone 4s and Ti SDK 2.1.3.v20120927181611. I have same problem.
  4. Olga Romero 2012-11-01

    Reopened due to existence on *iOS 6* iPhone5. Tested with: Titanium Studio, build: 3.0.0.201210291448 Titanium SDK, build: 2.1.4.v20121030173408 Devices: iPhone5 ios 6.0 iPad2 ios 4.3.5
  5. Vishal Duggal 2012-11-01

    Fixed in master and 3_0_X. Never backported to 2_1_X so test with 3.0.0 and later builds
  6. Natalie Huynh 2012-12-04

    Tested with 3.0.0.v20121130200208 n iPhone 4 5.1.1
  7. Marian Kucharcik 2015-10-12

    Hello, I have this issue on iP6/iP5/iP4S - iOS 8.4 simulator and also tested on iP6 iOS9 device and the issue is there. I have 3 textfields on screen and when I enter some text in that and press return, all of my UI is moved to left off screen and I can't move that in right place(on simulators I can move it, on iP6 device I can't). If there is not any value in the textdields, UI moves to the right posietion itself(tested on device). Appcelerator studio 4.3.1.201509222258, Ti SDK 4.1.1 GA Please have a look at this. Thank you

JSON Source