[TIMOB-9979] iOS: Longpress event on TableView is not reliable.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-09T03:43:53.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Sprint 2012-15 API, Release 3.0.0 |
Components | iOS |
Labels | module_tableview, qe-testadded |
Reporter | Sabil Rahim |
Assignee | Sabil Rahim |
Created | 2012-07-16T17:12:35.000+0000 |
Updated | 2014-06-19T12:42:59.000+0000 |
Description
The "longpress" event is inconsistent on iOS.
if you don't see the issue the first time, keep running it again , within 4 to 5 times you should be able see the issue.
Steps to Reproduce.
Copy the following code into app.js and run the app.
var win = Ti.UI.createWindow();
var tableData = []
var s = 0;
var nRow = 0;
for(var i = 0; i < 100; i++){
var createNewSection = (i + 1) % 10 == 9 || i == 0 ? true : false;
createNewSection ? nRow = 1 : nRow++;
tableData.push({
title:'Row #' + nRow + ' Index #' + i + ' Section #' + s,
customProp:'Hello World! #' + i,
header: createNewSection ? 'Section #' + s++ : null
});
}
var table = Ti.UI.createTableView({
data: tableData
});
win.add(table);
table.addEventListener('longpress', function(e){
Ti.API.info('Section: ' + e.section);
Ti.API.info('Row: ' + e.row);
Ti.API.info('Row Data: ' + e.rowData);
Ti.API.info('Index: ' + e.index);
Ti.API.info('customProp: ' + e.rowData.customProp);
});
win.open();
Fixed by PR #2579 against master https://github.com/appcelerator/titanium_mobile/pull/2579
Reopening to update labels
Exists on: Titanium Studio: 2.1.2.201208201549 Titanium SDK: 2.1.2.v20120821160113 Device: iPad3(v5.1) Fixed on SDK: 2.2.0