Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5954] iOS: click event fired more than once

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-11-14T09:55:29.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-45, Release 1.8.0.1
ComponentsiOS
Labelsclick, double, fired, module_label, qe-testadded, regression, triggered, view
ReporterKarol Pomaski
AssigneeReggie Seagraves
Created2011-11-01T14:53:05.000+0000
Updated2012-10-08T23:32:24.000+0000

Description

Problem

The click event is raised for every object on a view. For example if I have a view with a label (custom button). The click event will be raised twice when the user taps the view.

Regession issue - works fine with mobile SDKs 1.7.4.v20111025165811 & 1.7.3 & 1.7.2

Reproducible Steps

1. Run the sample code 2. Click the "Click me" label 3. Check the Titanium logs

Sample Code

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');


var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff',
    tabBarHidden:true
});


var vwTest = Ti.UI.createView({
	backgroundColor:'yellow',
	height:250,
	width:250
});
win1.add(vwTest);



vwTest.addEventListener('click', function(){
	Ti.API.info('You should only see this once per click... but');
	Ti.API.info('Click Event Firing');
});
		
var label1 = Titanium.UI.createLabel({
	text:'Click Me',
	color:'#000',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	height:250,
	width:250
});

vwTest.add(label1);

win1.open();

Associated HelpDesk Ticket

http://appc.me/c/APP-287373

Comments

  1. Michael Pettiford 2011-12-07

    Tested on Ti Studio 1.0.7.201112061404 
Ti Mob SDK 1.8.0.1.v20111207091653 
OSX Lion iPhone 4S OS 5.0.1 Expected behavior of only sending single click events is shown

JSON Source