Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2661] iOS: touchstart, touchend events on a view in ListView custom template crash app

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-10-26T20:23:15.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labels3.1.3.GA, event, listview, touchend
ReporterMark Mokryn
AssigneeMauro Parra-Miranda
Created2013-10-21T08:21:23.000+0000
Updated2016-03-08T07:41:45.000+0000

Description

Try a longpress and then release on a label in the listview. The longpress event registers fine, the touchend crashes the app. If you add onTouchstart="labelStart" to the XML, the crash will occur on the touchstart event. The longpress event works fine. The problem can be tracked down to calls to handleControlEvents in TiUIView.m index.xml:
<Alloy>
	<Window class="container">
		<ListView id="lv" top="0dp" defaultItemTemplate="temp1">
			<Templates>
				<ItemTemplate name="temp1">
						<Label bindId="testMsg" onLongpress="labelPressed" onTouchend="labelEnd"/>
				</ItemTemplate>
			</Templates>			
			<ListSection id="ls"/>
		</ListView>		
	</Window>
</Alloy>
index.js:
function labelPressed(e){
	Ti.API.info('longpress event: ' + JSON.stringify(e));	
}

function labelEnd(e){
	Ti.API.info('touchend event: ' + JSON.stringify(e));		
}

function labelStart(e){
	Ti.API.info('touchstart: ' + JSON.stringify(e));
}

var data = [];
for (var i=0; i < 10; i++) {
	data.push({testMsg: {text: 'Longpress and release - iOS crash on touchend'}});
}

$.ls.setItems(data);
$.index.open();

Comments

  1. Mark Mokryn 2013-10-21

  2. Mauro Parra-Miranda 2013-11-21

    DUP of TIMOB-14510.

JSON Source