Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7540] iOS: Titanium.UI.Label: click event fails to fire

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-02-14T23:29:02.000+0000
Affected Version/sRelease 1.8.0.1, Release 1.8.1
Fix Version/sSprint 2012-03, Release 2.0.0, Release 1.8.2
ComponentsiOS
Labelsmodule_label, qe-testadded, regression
ReporterDustin Hyde
AssigneeMax Stepanov
Created2012-02-03T11:03:57.000+0000
Updated2012-03-13T13:23:41.000+0000

Description

iOS: Titanium.UI.Label: click event fails to fire. Regression. Works in 1.7.5. Works on Android. Steps to Reproduce: 1. Run code.
var win = Ti.UI.createWindow({
	backgroundColor:'white',
	layout:'vertical'
	});
	
var label = Ti.UI.createLabel({
	text:'Click Label',
	color:'black',
	height:'auto',
	width:'auto'
	});

win.add(label);
win.open();

label.addEventListener('click',function(){
	Ti.API.info('Label Clicked');
	label.text = 'Label Clicked';
});
2. Click label. Expected Result: Label text should change to 'Label Clicked', and 'Label Clicked' should print to the console. Actual Result: Nothing happens. Note: Will investigate more hardware in future.

Comments

  1. Blain Hamon 2012-02-06

    Take a look at TiUIView.m, namely that now that I added gesture recognizers, I removed the toggling of userInteractionEnabled, since default is YES, and it turns out gesture recognizers don't care about view enablement (Test to see if "singletap" still triggers--that uses recognizers, click doesn't). It might be that the default of userInteractionEnabled is NO on UILabel, which may suppress the touch events that lead to click messages. If you jury-rig userInteractionEnabled to YES on TIUIView, and the regression magically goes away, then you know what to do.
  2. Max Stepanov 2012-02-06

    Thanks for the tip, Blain. However the issue is related to when the click listener is attached: before or after window open.
  3. Wilson Luu 2012-02-08

    Closing bug. Verified fix on: SDK build: 1.9.0.v20120207171634 Titanium Studio, build: 1.0.8.201201262211 xcode: 4.2 Devices: iphone 4S Sprint (5.0.1)

JSON Source