Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14530] iOS: Click event added to the ItemTemplate does not fire when clicking on a child view component (ListView)

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2014-09-03T05:33:51.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.4.0
ComponentsiOS
Labelsn/a
ReporterBenjamin Hatfield
AssigneeIngo Muschenetz
Created2013-07-11T20:53:22.000+0000
Updated2014-09-12T22:35:42.000+0000

Description

ENVIRONMENT: Mac OS X 10.7.5 Appcelerator Studio, build: 3.1.1.201306131423 TiSDK 3.1.1.GA and 3.2.0.v20130710174319 Xcode 4.5.2 / iOS 6.1 Android 4.2 REPRODUCTION: Run the code below in the iOS simulator, then click on the rows. RESULTS: The click event is only fired when clicking on the button. If you click on the label, image or anywhere besides the button, the click event does not fire. OTHER INFO: Works fine on the Android emulator. Click events fire if it is added to the child template.

var win = Ti.UI.createWindow({backgroundColor: 'white'});
 
var plainTemplate = {
    childTemplates: [
        {
            type: 'Ti.UI.Label',
            bindId: 'rowtitle',
            properties: {
                left: '10dp'
            }
        },
        {
            type: 'Ti.UI.ImageView',
            bindId: 'pic',
            properties: {
                image: 'KS_nav_ui.png'
            }
        },
        {
            type: 'Ti.UI.Button',
            bindId: 'button',
            properties: {
                width: '80dp',
                height: '30dp',
                right: '10dp',
                title: 'press me'
            }
        }
    ],
    events: { click : report }

};
 
function report(e) {
    Ti.API.info(e.type);
}
 
var listView = Ti.UI.createListView({
    templates: { 'plain': plainTemplate },
    defaultItemTemplate: 'plain'
});
 
var data = [];
for (var i = 0; i < 10; i++) {
    data.push({
        rowtitle : { text: 'Row ' + (i + 1) },
    });
}

var section = Ti.UI.createListSection({items: data});
listView.sections = [section];
win.add(listView);
win.open();

Comments

  1. Shameer Jan 2014-09-03

    Bug exist with TiSDK 3.1.1.GA and 3.2.0 but cannot reproduce with 3.4.0 GA Appcelerator Studio, build: 3.3.0.201407111535 iOS 6.1
  2. Wilson Luu 2014-09-12

    Closing ticket as fixed. Verified the click event gets fired when pressing on the button, label, and imageView. Tested on: Appcelerator Studio, build: 3.4.0.201409112242 SDK build: 3.4.0.v20140912120914 CLI: 3.4.0-rc2 Alloy: 1.5.0-rc Xcode: 6 GM Seed Devices: iphone 5 (8.0 GM Seed), iphone 5 (7.1)

JSON Source