Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15347] iOS7: Button click event listener not firing consistently when button is clicked quickly

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.3
Fix Version/sn/a
ComponentsiOS
Labelsqe-3.2.0, reprod
ReporterEric Merriman
AssigneeUnknown
Created2013-09-26T00:03:44.000+0000
Updated2018-02-28T20:04:01.000+0000

Description

Description:

When clicking a button quickly (not "button mashing" speed, about 114 clicks per minute) a click event listener on the button will not fire consistently. This can be demonstrated with the code below. Clicking the button at a slower pace, around 75 clicks a minute will fire the event listener consistently

var win1 = Titanium.UI.createWindow({  
    title:'Click event test',
    backgroundColor:'#fff',
    layout: "vertical"
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'Click counter',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto',
	top: 50
});

var myButton = Ti.UI.createButton({
	title: "Click Me",
	top: 100
});

var count = 0;

myButton.addEventListener("click", function(){
	count=count+1;
	label1.text="The count is now: "+count;
	
});

win1.add(label1);
win1.add(myButton);

win1.open();

Steps to reproduce:

1) Create a project with the code above 2) Run on iOS device or in simulator 3) Click button at a "brisk pace" about 114 clicks per minute

Result:

click event listener does not fire

Expected Result:

event listener fires consistently.

Comments

  1. Samuel Dowse 2013-09-26

    Additional Info: Changing the event listener from "click" to "singletap" will fire consistently regardless of button tap speed.
  2. Shameer Jan 2014-08-08

    Issue reproduces Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0.GA iOS SDK: 7.1 iOS iPhone Simulator: 7.1
  3. Lee Morris 2017-06-26

    I am able to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source