[AC-2547] TextField never looses focus when action performed in Blur event (re-focuses afterwards)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-10-11T20:35:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | blur, focus, ios, textfield |
Reporter | Gavin Harriss |
Assignee | Mauro Parra-Miranda |
Created | 2012-10-09T22:44:20.000+0000 |
Updated | 2016-03-08T07:41:36.000+0000 |
Description
As of 2.1.3.GA it's no longer possible to loose focus from TextFields if you're performing some action in the 'blur' event.
Blur event code will fire, but the TextField will gain focus again, making the keyboard active again and so preventing access to UI elements obscured by the keyboard.
Interestingly, the 'focus' event does not seem to get fired when the TextField gets the focus again (but not 100% sure!).
Below is an example of some code that triggers this. This code simply removes a background color I'm applying to a TableRow highlighting the data item being edited.
txtUsername.addEventListener('blur', function(e) {
FM.settings.setUsername(txtUsername.value.trim());
txtOnBlur(e);
});
function txtOnBlur(e) {
var truerow = FM.ui.helper.getTrueRowByType(e.source)
truerow.setBackgroundColor(FM.ui.theme.tableViewRowBackgroundNormal);
};
Looks like a duplicate of TC-1343 with a textField in a tableView. Fix was pushed to 2_1_X branch a few days ago. Marking this as resolved. If the problem persists please reopen the issue. Would appreciate a bigger code sample.
Closing since it's a dup.