Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8719] iOS: iPad: TableView: Soft keyboard does not appear and last row is not focused in landscape mode

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2012-05-11T16:07:42.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sn/a
ComponentsiOS
Labelsapi, qe-ios040912
ReporterTamila Smolich
AssigneeNeeraj Gupta
Created2012-04-13T11:30:21.000+0000
Updated2017-03-09T23:28:04.000+0000

Description

Description: Soft keyboard does not appear and last row is not focused if test case launched in landscape mode. This bug occurs on 1.8.2 and 2.0.0. Steps: Run the following code on iPad in landscape mode:
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();
Expected result: The app automatically focuses the last row in the table view, popping up the keyboard Actual result: Soft keyboard does not appear and last row is not focused

Comments

  1. Vishal Duggal 2012-05-11

    You can not focus a field that is not attached to the view. If the use case is that you need to attach a field that is off screen use a container that guarantees all children are attached (eg: ScrollVIew). Tableview optimizations include only loading rows that are currently visible.
  2. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source