Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15108] iOS: 'click' events are not fired for TabGroup and Tabs

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-09-26T07:48:30.000+0000
Affected Version/sRelease 3.0.2, Release 3.1.0, Release 3.1.1, Release 3.1.2, Release 3.1.3
Fix Version/sn/a
ComponentsAndroid
Labelsdev-invalidate, qe-3.1.3
ReporterFederico Casali
AssigneeIngo Muschenetz
Created2013-09-10T04:12:30.000+0000
Updated2017-03-21T22:07:49.000+0000

Description

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.

Comments

  1. jithinpv 2014-09-26

    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
  2. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source