Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8720] iOS: iPad - TableView: Soft keyboard disappears and last text field losses its focus after rotating device to landscape mode

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-05-15T13:35:53.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-10 API
ComponentsiOS
Labelsapi, module_tableview, qe-ios040912, qe-testadded, regression
ReporterTamila Smolich
AssigneeVishal Duggal
Created2012-04-13T11:31:37.000+0000
Updated2013-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

FileDateSize
IMG_0005.PNG2012-05-14T11:28:14.000+0000164940

Comments

  1. Vishal Duggal 2012-05-11

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2177
  2. Vishal Duggal 2012-05-11

    Test code you can run on iPhone,iPAD
       var win = Ti.UI.createWindow({ 
       	title: 'Focus Test', 
       	backgroundColor: '#fff',
       	orientationModes:[Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT,Ti.UI.UPSIDE_PORTRAIT]
       });
         
       var rows = [];
       for (var i = 0; i < 40; i++) {
           var row = Ti.UI.createTableViewRow({
               height: 40
           });
           row.add(row.textField = Titanium.UI.createTextField({
               value: 'This is row .'+i,
               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();
       
  3. Stephen Tramer 2012-05-14

    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)
  4. Vishal Duggal 2012-05-15

    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
  5. Tamila Smolich 2012-06-14

    Closing bug as fixed. Tested and verified on: Titanium Studio, build: 2.1.0.201206131907 Titanium SDK: 2.1.0.v20120613210250

JSON Source