[TIMOB-13173] Android: TableView: Softkeyboard appears on clicking any tableviewrow but immediately disappear
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-03-25T23:38:11.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | 2013 Sprint 07 API, 2013 Sprint 07 |
Components | Android |
Labels | qe-sdk3.1.0, regression |
Reporter | Dhirendra Jha |
Assignee | Ping Wang |
Created | 2013-03-23T10:43:01.000+0000 |
Updated | 2013-11-07T17:56:02.000+0000 |
Description
This is regression. The issue does not exist on 3.0.2. But the textfield in tableviewrow is never editable on any build.
Steps to Reproduce:
1. Create an application with code below and launch the application
2. Click on any row in the tableview
Actual: Softkeyboard appears but disappears immediately.
Expected: Softkeyboard should not disappear immediately. It should disappear when click return on the keyboard.
var _window = Ti.UI.createWindow();
_window.fullscreen = false;
_window.backgroundColor = 'white';
var tableView = Ti.UI.createTableView({
top : '0dp',
bottom : '0dp',
left : '0dp',
right : '0dp'
});
var numRows = 15;
var rows = [];
for (var i = 0; i < numRows; i++){
var tableViewRow = Ti.UI.createTableViewRow({
height : 'auto'
});
var textField = Ti.UI.createTextField({
top:'0dp',
left : '5dp',
right : '5dp',
borderColor : '#CCCCCC',
borderStyle : Ti.UI.INPUT_BORDERSTYLE_BEZEL
});
tableViewRow.add(textField);
rows.push(tableViewRow);
}
tableView.data = rows;
_window.add(tableView);
_window.open();
This is not a regression bug. This behavior change is due to the [PR#3515](https://github.com/appcelerator/titanium_mobile/pull/3515) which fixed TIMOB-6367. When the textfield is clicked, it gains the focus so the softkeyboard shows and the table view needs to re-layout. After re-layout, everything is re-drawn and the textfield loses the focus so the softkeyboard hides. If we want to edit the textfield in the tableview, we need to set "windowSoftInputMode: Ti.UI.Android.SOFT_INPUT_ADJUST_PAN" when creating the window. An example is attached at the end. This is a native android behavior. Similar discussion is [here](http://stackoverflow.com/questions/5615436/when-the-soft-keyboard-appears-it-makes-my-edittext-field-lose-focus).
As per the comment, this is invalid issue. Hence closing this issue.