Project: titanium
Issue TIMOB-18155: iOS: Tab doesn't fire FOCUS event when switching while TabGroup is inside a TableView
First Tab of a TabGroup is not firing *FOCUS* event when switching between tabs while the TabGroup is inside a TableView. h5. Steps To Reproduce 1. Create a classic app using following code {code} // this sets the background color of the master UIView (when there are no windows/tab groups on it) Titanium.UI.setBackgroundColor('#000'); var tbl_data = [	{title:'Row 1'},	{title:'Row 2'},	{title:'Row 3'} ]; var table = Titanium.UI.createTableView({	data:tbl_data }); table.addEventListener('click', function(event) {	var tabGroup = Titanium.UI.createTabGroup();	var win1 = Titanium.UI.createWindow({	name:'win1',	title:'Tab 1',	backgroundColor:'#fff'	});	var tab1 = Titanium.UI.createTab({	name:'tab1',	icon:'KS_nav_views.png',	title:'Tab 1',	window:win1	});	var win2 = Titanium.UI.createWindow({	name:'win2',	title:'Tab 2',	backgroundColor:'#fff'	});	var tab2 = Titanium.UI.createTab({	name:'tab2',	icon:'KS_nav_ui.png',	title:'Tab 2',	window:win2	});	tabGroup.addTab(tab1);	tabGroup.addTab(tab2);	tabGroup.addEventListener('focus', function(e) {	Ti.API.info('-------------> tabGroup focus event fired! - ' + e.source.name);	});	tab1.addEventListener('focus', function(e) { Ti.API.info('-------------> tab1 focus event fired! - ' + e.source.name); }); tab2.addEventListener('focus', function(e) { Ti.API.info('-------------> tab2 focus event fired! - ' + e.source.name); }); win1.addEventListener('focus', function(e) { Ti.API.info('-------------> win1 focus event fired! - ' + e.source.name); }); win2.addEventListener('focus', function(e) { Ti.API.info('-------------> win2 focus event fired! - ' + e.source.name); }); tab1.addEventListener('blur', function(e) { Ti.API.info('**************> tab1 blur event fired! - ' + e.source.name); }); tab2.addEventListener('blur', function(e) { Ti.API.info('**************> tab2 blur event fired! - ' + e.source.name); }); win1.addEventListener('blur', function(e) { Ti.API.info('**************> win1 blur event fired! - ' + e.source.name); }); win2.addEventListener('blur', function(e) { Ti.API.info('**************> win2 blur event fired! - ' + e.source.name); }); tabGroup.open(); }); table.setData(tbl_data); var win = Ti.UI.createWindow(); win.add(table); win.open(); {code} 2. Run the app in iOS device 3. Switch between Tab1 and Tab2 few times h5. Actual Result Tabs are *not triggered* focus event properly for every time. Following is the console log: {code} [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> tab1 focus event fired! - tab1 [INFO] : -------------> win1 focus event fired! - win1 [INFO] : **************> win1 blur event fired! - win1 [INFO] : **************> tab1 blur event fired! - tab1 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> tab2 focus event fired! - tab2 [INFO] : -------------> win2 focus event fired! - win2 [INFO] : **************> win2 blur event fired! - win2 [INFO] : **************> tab2 blur event fired! - tab2 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win1 focus event fired! - win1 [INFO] : **************> win1 blur event fired! - win1 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win2 focus event fired! - win2 [INFO] : -------------> tab2 focus event fired! - tab2 [INFO] : **************> win2 blur event fired! - win2 [INFO] : **************> tab2 blur event fired! - tab2 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win1 focus event fired! - win1 [INFO] : **************> win1 blur event fired! - win1 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win2 focus event fired! - win2 [INFO] : **************> win2 blur event fired! - win2 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win1 focus event fired! - win1 [INFO] : **************> win1 blur event fired! - win1 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win2 focus event fired! - win2 [INFO] : **************> win2 blur event fired! - win2 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win1 focus event fired! - win1 [INFO] : **************> win1 blur event fired! - win1 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win2 focus event fired! - win2 [INFO] : **************> win2 blur event fired! - win2 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win1 focus event fired! - win1 [INFO] : **************> win1 blur event fired! - win1 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> win2 focus event fired! - win2 {code} h5. Expected Result Tab focus event should be triggered properly every time. Following console log *should repeat* for every focus event. {code} [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> tab1 focus event fired! - tab1 [INFO] : -------------> win1 focus event fired! - win1 [INFO] : **************> win1 blur event fired! - win1 [INFO] : **************> tab1 blur event fired! - tab1 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> tab2 focus event fired! - tab2 [INFO] : -------------> win2 focus event fired! - win2 [INFO] : **************> win2 blur event fired! - win2 [INFO] : **************> tab2 blur event fired! - tab2 [INFO] : -------------> tabGroup focus event fired! - undefined [INFO] : -------------> tab1 focus event fired! - tab1 [INFO] : -------------> win1 focus event fired! - win1 {code}
Story points: 8