Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9567] Android: TextField: Blur event fires for text field added to a tableviewrow on rotation of device

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, qe-and060112, reprod
ReporterSatyam Sekhri
AssigneeUnknown
Created2012-06-15T03:59:57.000+0000
Updated2018-02-28T20:03:56.000+0000

Description

On rotation of device from Portrait to Landscape or vice-versa, an text field that has focus gets blur. This happens for text field added to a TableViewRow This is not a regression. This behavior occurs on 1.8.2 also Steps to Reproduce: 1. Create an application with the code below 2. Launch the application 3. Click on the text field. The field gets focus and softkeyboard is shown 4. Rotate the device Actual: The blur event for the text field is fired Expected: The focus on text field should continue
var win = Ti.UI.createWindow({
		softInputMode : (Titanium.UI.Android) ? Ti.UI.Android.SOFT_INPUT_ADJUST_PAN : '',
		windowSoftInputMode : (Titanium.UI.Android) ? Ti.UI.Android.SOFT_INPUT_ADJUST_PAN : ''
		});

		var tf1 = null;
			var row = Ti.UI.createTableViewRow({
				backgroundColor: "#000",
				height : 80
			});
			
			tf1 = Titanium.UI.createTextField({
				backgroundColor: "#fff",
				width : 250,
				height : 80,
			});
			
			tf1.addEventListener('focus', function() {
				alert('Focus fired');
			});
		
			tf1.addEventListener('blur', function() {
				alert('Blur fired');
			});
			
			row.add(tf1);
			
		var tableView = Ti.UI.createTableView();
		tableView.appendRow(row);
		win.add(tableView);
		win.open();

Comments

  1. jithinpv 2013-02-26

    issue is reproduced with sdk version 3.0.2 and 3.1.0 .
  2. Lee Morris 2017-07-05

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source