Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15102] Bubbling of events in listview items in newer android versions

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, listitem, onclick
ReporterÞórhallur Helgason
AssigneeUnknown
Created2013-09-04T11:26:24.000+0000
Updated2018-02-28T20:04:16.000+0000

Description

For some reason, and after upgrading Android to 4.x from 2.x, the itemclick event on ListView doesn't fire anymore. It works if you click on the very edge of the item, i.e. if you manage to click on the ListItem itself directly and not on any child items. Our Alloy template is set up like this:
<Alloy>
	<Window class="view" layout="vertical">
		<ListView id="objectList">
			<Templates>
				<ItemTemplate name="file" height="50">
					<ImageView bindId="image" class="image"/>
					<Label bindId="name" class="filename text-and-image" />
					<Label bindId="filesize" class="filesize text-and-image" />
					<Label bindId="lastModified" class="lastModified" />
				</ItemTemplate>
				<ItemTemplate name="folder" height="50">
					<ImageView bindId="image" class="folderImage"/>
					<Label bindId="name" class="folder text-and-image" />
				</ItemTemplate>
				<ItemTemplate name="back" height="50">
					<ImageView bindId="image" class="folderImage"/>
					<Label bindId="name" class="folder text-and-image" />
				</ItemTemplate>
			</Templates>

			<ListSection id="objectListSection" />
		</ListView>
	</Window>
</Alloy>
And then in our controller we have the following:
$.objectList.addEventListener('itemclick', function(e){
	handleAction(e);
});
This works perfectly fine in iOS and in older versions of Android, but in 4.x, nothing...

Comments

  1. Mauro Parra-Miranda 2013-09-09

    Hello, can you please provide some logs? Best, Mauro

JSON Source