[TIMOB-13723] Android: TableView longclick event fired twice.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-05T00:13:47.000+0000 |
Affected Version/s | Release 3.1.0, Release 3.2.0 |
Fix Version/s | 2013 Sprint 12 API, 2013 Sprint 12, Release 3.1.2, Release 3.2.0 |
Components | Android |
Labels | module_tableview, qe-closed-3.1.2, qe-testadded, regression |
Reporter | Yoram |
Assignee | Sunila |
Created | 2013-04-21T16:36:15.000+0000 |
Updated | 2014-06-19T12:44:01.000+0000 |
Description
*Actual result*
The TableView 'longclick' event is fired twice.
*Expected result*
The event should only fire once.
*Steps to reproduce*
1. Run the test case
2. Search for LONGCLICK in DDMS
3. Hold finger down on one of the rows
4. Verify that it's called twice
*Test case*
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
var data = [{
title : 'Apples'
}, {
title : 'Bananas'
}, {
title : 'Carrots'
}, {
title : 'Potatoes'
}];
var table = Ti.UI.createTableView({
data : data
});
table.addEventListener('longclick', function(e) {
Ti.API.info('LONGCLICK');
});
win.add(table);
win.open();
Hi Y, Please provide a complete reproducible test case that we can drop into an app.js and run. Also state your Ti SDK version. Thanks.
It's simple as it sounds... here is a sample:
The message *LONGCLICK* triggered twice instead of once.
Ti SDK 3.1 - Android
Tested and confirmed on Samsung Galaxy S2 Android 2.3.6 with Ti SDK 3.2 CI, 3.1 GA. Works as expected (fires once) on 3.0 GA and below.
Do not fire longClick if it is already fired on rowProxy https://github.com/appcelerator/titanium_mobile/pull/4233
Is there a fix around this issue?
Hi Thomas, The fix is included in the pull request linked above your comment, but it has yet to be merged into the master branch. If you really need the fix you can always build the SDK yourself, but I can't imagine it will be long before it will be available in the master CI build.
backport PR: https://github.com/appcelerator/titanium_mobile/pull/4486
Tested above code and verified correct behavior with: Appcelerator Studio, build: 3.1.2.201308021524 Titanium SDK, build: 3.1.2.v20130806104555 Alloy 1.2.0-alpha6 CLI: 3.1.2-alpha Devices: Nexus7(2) Android version 4.3 GalaxyS3 Android version 4.0.4