Problem
TextField (on a TableViewRow) loses focus mysteriously after being focused with a click. The keyboard pops up correctly, but then focus is removed from the TextField (blur does fire), even though the keyboard remains. Typing on the keyboard does not affect the TextField. A second click of the TextField focuses it and the keyboard works.
Also, the same TextField can't be focused with .focus()...the call to .focus() is simply ignored.
Testcase
{panel:title=app.js}
var win1 = Ti.UI.createWindow({
backgroundColor:'black'
});
win1.addEventListener('open',MainWinLoad);
function MainWinLoad()
{
Ti.API.info('--> trying to focus the text field');
TheTextField.focus();
}
var TheListBox=Ti.UI.createTableView({width:'auto'});
var BIRow=Ti.UI.createTableViewRow({color:'white',
title:'No background image',
height:120});
var TheTextField=Ti.UI.createTextField({keyboardType:Ti.UI.KEYBOARD_DEFAULT,
returnKeyType:Ti.UI.RETURNKEY_DEFAULT,
autocorrect:false,
width:100,
top:55,
left:2
});
BIRow.add(TheTextField);
TheListBox.appendRow(BIRow);
win1.open();
win1.add(TheListBox);
{panel}
Tested this back to 2.1.2.GA and still see the same behavior on Samsung SIII 4.0.4
The textfield does not focus because the underlying native view is not realized when the open event is fired. Due to limitations of the underlying OS we do not support placing textfield/textareas inside tableview rows. See the discussion in the linked tickets TIMOB-8332 and TIMOB-8869 Marking the ticket as wont fix.