[AC-2661] iOS: touchstart, touchend events on a view in ListView custom template crash app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-10-26T20:23:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | 3.1.3.GA, event, listview, touchend |
Reporter | Mark Mokryn |
Assignee | Mauro Parra-Miranda |
Created | 2013-10-21T08:21:23.000+0000 |
Updated | 2016-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();
DUP of TIMOB-14510.