Problem
The "click" event is not triggered for TabGroup and Tabs.
Reproducible Steps
1. Use the example code from above
2. Click on the tabs
Sample Code
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,
fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
label1.addEventListener('click', function(){
alert('clicked!');
});
win1.add(label1);
//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win2.add(label2);
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win2
});
// tabGroup.addEventListener('click', function(e) {
// Ti.API.info("clicked tabgroup");
// alert('pippo');
// });
// tabs don't fire 'click' events
tab1.addEventListener('click', function(e) {
Ti.API.info("clicked tab1");
alert('pippo');
});
tab2.addEventListener('click', function(e) {
Ti.API.info("clicked tab2");
alert('Clicked');
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
// open tab group
tabGroup.open();
Note
Reproducible with all TiSDK versions tested. Not a regression.
Cannot reproduce Titanium SDK version 3.4.0 master, 3.1.2.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
Closing ticket as the issue cannot be reproduced and due to the above comments.