[TIMOB-8720] iOS: iPad - TableView: Soft keyboard disappears and last text field losses its focus after rotating device to landscape mode
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-15T13:35:53.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0, Sprint 2012-10 API |
Components | iOS |
Labels | api, module_tableview, qe-ios040912, qe-testadded, regression |
Reporter | Tamila Smolich |
Assignee | Vishal Duggal |
Created | 2012-04-13T11:31:37.000+0000 |
Updated | 2013-08-30T10:11:01.000+0000 |
Description
Description:
Soft keyboard disappears and last text field losses its focus after rotating device to landscape mode.
This bug does not occur on 2.0.0, but exists on 1.8.2
Steps:
1. Run the following code on iPad:
var win = Ti.UI.createWindow({ title: 'Focus Test', backgroundColor: '#fff' });
var rows = [];
for (var i = 0; i < 20; i++) {
var row = Ti.UI.createTableViewRow({
height: 40
});
row.add(row.textField = Titanium.UI.createTextField({
value: 'Last row focused; Scroll up, and then try to scroll back down.',
color: '#000',
top: 5, right: 10, bottom: 5, left: 10,
borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
}));
rows.push(row);
}
win.add(Ti.UI.createTableView({
data: rows
}));
win.addEventListener('open', function() {
rows[rows.length - 1].textField.focus();
});
win.open();
2. Rotate device to landscape mode
Expected result:
Soft keyboard should not disappear and last row should stay focusable
Actual result:
Soft keyboard disappears and last row losses its focus
Attachments
File | Date | Size |
---|---|---|
IMG_0005.PNG | 2012-05-14T11:28:14.000+0000 | 164940 |
Pull pending https://github.com/appcelerator/titanium_mobile/pull/2177
Test code you can run on iPhone,iPAD
Issue introduced by PR: *Keyboard floats* 1. Rotate into landscape 2. Rotate back into portrait 3. Repeat 1 & 2 (possibly rotating into other orientations along the way) Speed of rotations may play a role. OR 1. Sometimes in evidence on app startup (iPad 1, 5.0.1)
The issue mentioned above is because the keyboard gets undocked while fast ui switching. Race condition between the keyboard animation and the manual rotation animation. Too much of our code depends on manual rotation so not much we can do right now without risking a whole bunch of regressions. Need to revisit our orientation management system post 2.1.0
Closing bug as fixed. Tested and verified on: Titanium Studio, build: 2.1.0.201206131907 Titanium SDK: 2.1.0.v20120613210250