[TIMOB-7618] Android: Text field loses focus when changing orientation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-01-09T19:50:04.000+0000 |
Affected Version/s | Release 2.0.0, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | parity, reprod |
Reporter | Allen Yeung |
Assignee | Maggie Chen |
Created | 2012-02-10T14:58:44.000+0000 |
Updated | 2020-01-09T19:50:04.000+0000 |
Description
In the following code, if you select a textfield, and rotate the phone to landscape, the textfield loses focus, and a blur event is fired.
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;
function addRow() {
var row = Ti.UI.createTableViewRow({
height : 80,
//touchEnabled:false
});
tf1 = Titanium.UI.createTextField({
color : '#336699',
width : 250,
height : 80,
focusable : true,
returnKeyType : Titanium.UI.RETURNKEY_DONE,
//autocapitalization : Titanium.UI.TEXT_AUTOCAPITALIZATION_WORDS,
autocorrect : false,
suppressReturn : true,
});
tf1.addEventListener('focus', function() {
Ti.API.info('Focus fired');
alert('Focus fired');
});
tf1.addEventListener('blur', function() {
Ti.API.info('blur fired');
alert('Blur fired');
});
row.add(tf1);
//row.selectionStyle = Ti.UI.iPhone.TableViewCellSelectionStyle.NONE;
//row.className = 'control';
return row;
}
// create table view data object
var data = [];
for(var x = 0; x < 10; x++) {
data[x] = addRow();
}
var tableView = Ti.UI.createTableView({
data : data,
//style : Titanium.UI.iPhone.TableViewStyle.GROUPED
});
win.add(tableView);
win.open();
The expected behavior is for the textfield to remain focused after the orientation.
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) Device: Samsung galaxy s duos Android version: 4.0.4 jithinpv
I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 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.8.0_131
PR https://github.com/appcelerator/titanium_mobile/pull/9515
It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.