Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13723] Android: TableView longclick event fired twice.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-05T00:13:47.000+0000
Affected Version/sRelease 3.1.0, Release 3.2.0
Fix Version/s2013 Sprint 12 API, 2013 Sprint 12, Release 3.1.2, Release 3.2.0
ComponentsAndroid
Labelsmodule_tableview, qe-closed-3.1.2, qe-testadded, regression
ReporterYoram
AssigneeSunila
Created2013-04-21T16:36:15.000+0000
Updated2014-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();

Comments

  1. Daniel Sefton 2013-04-22

    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.
  2. Yoram 2013-04-25

    It's simple as it sounds... here is a sample:
       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();
       
    The message *LONGCLICK* triggered twice instead of once.
  3. Yoram 2013-04-25

    Ti SDK 3.1 - Android
  4. Daniel Sefton 2013-04-30

    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.
  5. Sunila 2013-05-07

    Do not fire longClick if it is already fired on rowProxy https://github.com/appcelerator/titanium_mobile/pull/4233
  6. Thomas Neerup 2013-05-29

    Is there a fix around this issue?
  7. Daniel Sefton 2013-05-29

    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.
  8. Ping Wang 2013-07-24

    backport PR: https://github.com/appcelerator/titanium_mobile/pull/4486
  9. Olga Romero 2013-08-06

    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

JSON Source