Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9354] MobileWeb: Too many click and singletap events fired for Tab and TabGroup

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-06-06T11:13:50.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-12 MW
ComponentsMobileWeb
Labelsn/a
ReporterChris Barber
AssigneeChris Barber
Created2012-06-04T05:17:54.000+0000
Updated2012-08-01T14:32:21.000+0000

Description

Expected behavior

Click events should be fired on the tab regardless of whether or not the tab is currently selected.

Actual behavior

The click event in a tab element of a tabGroup is not fired in either Titanium versions listed above Note that this also did not work on Android 1.7.5, but the issue has been fixed in Android 1.8.0.1. Thus, this is a parity issue to match a recent Android feature request (see linked ticket).

Test case

With the following code, no click event is fired on iOS when tab1 is clicked:
Ti.UI.setBackgroundColor('#000');

var tabGroup = Ti.UI.createTabGroup();

var win1 = Ti.UI.createWindow({
  title:'Tab 1',
  backgroundColor:'#fff'
});
var tab1 = Ti.UI.createTab({
  title:'Tab 1',
  window:win1
});

var label1 = Ti.UI.createLabel({
  color:'#999',
  text:'I am Window 1',
  textAlign:'center',
  width:'auto'
});

win1.add(label1);

var win2 = Ti.UI.createWindow({
  title:'Tab 2',
  backgroundColor:'#fff'
});
var tab2 = Ti.UI.createTab({
  title:'Tab 2',
  window:win2
});

var label2 = Ti.UI.createLabel({
  color:'#999',
  text:'I am Window 2',
  textAlign:'center',
  width:'auto'
});

win2.add(label2);

tabGroup.addTab(tab1);
tabGroup.addTab(tab2);

tabGroup.open();

tab1.addEventListener('click', function(e) {
  Ti.API.info("tab1 clicked.");
});

Attachments

FileDateSize
app.js2012-06-06T03:50:58.000+00005343

Comments

  1. Chris Barber 2012-06-06

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/2337 Test with attached app.js and test with KitchenSink (specifically slider).
  2. Lokesh Choudhary 2012-08-01

    Tested On: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120731184111 Android 4.0.4 - default ,chrome 18.0 Iphone 5.0.1 - safari mobile Mac osx - chrome 21,safari 5.1.4,firefox 14.0.1

JSON Source