[TIMOB-13141] Android: ListView itemclick event does not fire when clicking on the accessory
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-27T01:33:14.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 07 API, 2013 Sprint 07 |
Components | Android |
Labels | listview, qe-testadded, triage |
Reporter | Benjamin Hatfield |
Assignee | Hieu Pham |
Created | 2013-03-20T21:36:57.000+0000 |
Updated | 2013-09-20T09:32:01.000+0000 |
Description
Run the following code below in the Android emulator.
Click on the accessories (checkmark, detail button, disclosure indicator). The itemclick event does not fire.
Click anywhere else on the cell. The itemclick event fires.
EXPECTED BEHAVIOR:
itemclick should still fire when clicking on the accessory.
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var listView = Ti.UI.createListView();
var tasks = [
{id: 'trash', name: 'Take Out the Trash', icon: 'KS_nav_views.png', accessory: Ti.UI.LIST_ACCESSORY_TYPE_DETAIL},
{id: 'dishes', name: 'Do the Dishes', icon: 'KS_nav_views.png', accessory: Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE},
{id: 'doggie', name: 'Walk the Dog', icon: 'KS_nav_views.png', accessory: Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK}
];
var data = [];
for (var i = 0; i < tasks.length; i++) {
data.push(
{ properties: {
itemId: tasks[i].id,
title: tasks[i].name,
image: tasks[i].icon,
accessoryType: tasks[i].accessory,
color: 'black'
}
});
}
var section = Ti.UI.createListSection();
section.setItems(data);
listView.sections = [section];
listView.addEventListener('itemclick', function(e){
Ti.API.info(JSON.stringify(e));
});
win.add(listView);
win.open();
PR: https://github.com/appcelerator/titanium_mobile/pull/4033
Closing as working fine. Verified on: Device : Google Nexus 7, Android Version: 4.1 SDK: 3.1.0.v20130409124549 CLI version : 3.1.0-cr OS : MAC OSX 10.7.5 Appcelerator Studio, build: 3.1.0.201304052347 XCode : 4.5.1