[TIMOB-9725] Android: Tableview:Softkeyboard hiding on blur event call depends on number of rows in tableview
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 2.1.0, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | api, qe-and060112 |
Reporter | Shyam Bhadauria |
Assignee | Unknown |
Created | 2012-06-22T06:15:04.000+0000 |
Updated | 2018-02-28T20:03:52.000+0000 |
Description
This is not a regression.It exists as far as 1.8.2
Steps to reproduce:
1) Use the code below:
var win=Titanium.UI.createWindow();
win.backgroundColor='red';
var tf1 = null;
function addRow() {
var row = Ti.UI.createTableViewRow({
backgroundColor: "#000",
height : 80
});
tf1 = Titanium.UI.createTextField({
backgroundColor: "#fff",
width : 250,
height : 80,
focusable : true,
returnKeyType : Titanium.UI.RETURNKEY_DONE,
autocorrect : false,
suppressReturn : true,
});
tf1.addEventListener('focus', function() {
alert('Focus fired');
});
row.add(tf1);
return row;
}
var data = [];
for(var x = 0; x < 20; x++) {
data[x] = addRow();
}
var tableView = Ti.UI.createTableView({
data : data,
});
Ti.Gesture.addEventListener('orientationchange',function(){
tf1.blur();
alert('blur fired');
})
win.add(tableView);
win.open();
2) Run the app in portrait mode.
3) Click on any row of the tableview.
4) Click ok on the focus alert and rotate the device to landscape mode.
5) Click ok on the blur event and click on any row of the tableview.
6) Click ok on the focus alert and rotate the device back to portrait mode.
Expected result:
2) After step 2, app should be running with tableview shown along with 10 rows.
3) 'Focus fired' alert and soft keyboard should be displayed.
4) 'Blur fired' alert should be displayed and soft keyboard should be hidden.
5) 'Focus fired' alert and soft keyboard should be displayed.
6) 'Blur fired' alert should be displayed and soft keyboard should be hidden.
Actual result:
2) After step 2, app gets running with tableview shown along with 10 rows.
3) 'Focus fired' alert and soft keyboard gets displayed.
4) 'Blur fired' alert is displayed and soft keyboard gets hidden.
5) 'Focus fired' alert and soft keyboard gets displayed.
6) 'Blur fired' alert is displayed and soft keyboard is not hidden.
When the number of rows get out of screen,keyboard stops hiding on blur event call.If number of rows are kept like under 5,softkeyboard gets hide as expected.
Particular issue -
In above code, replace
var win=Titanium.UI.createWindow();
win.backgroundColor='red';
with
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 : ''
});
Now portrait to landscape orientationchange will always hide the softkeyboard,but landscape to portrait would not hide it for larger(say >20) no. of rows.
The problem reproduces with release 3.0.2 and master release 3.1.0 Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 I observed that the issue is not consistant.Sometimes it shows expected behavior and sometimes its not.Most probably its a bug.