Problem description
If window has "focus" event listener attached and it contains text fields, text fields triggers window's focus event.
Sample code
var win = Ti.UI.createWindow({
backgroundColor: '#000',
layout: 'vertical',
navBarHidden: true
});
for (var i = 0; i < 10; ++i) {
var tf = Ti.UI.createTextField({
width: 200
});
win.add(tf);
}
win.addEventListener('focus', function() {
Ti.API.info('Window focused!');
});
win.open();
Clicking on the textFields not focused, the windows 'focus' event listener is triggered.
Expected behavior:
Text fields 'focus' event listener should not be triggered in this case
Confirmed. Moving to TIMOB
'focus' event bubbles from child to parent, child can cancel the bubbling by setting the 'cancelBubble' property on the event in the child's event handler.
Closing ticket as invalid.