Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16489] Android: TableView longclick event also fires click when row has view inside

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-03-18T19:52:43.000+0000
Affected Version/sn/a
Fix Version/s2014 Sprint 06, 2014 Sprint 06 SDK, Release 3.3.0
ComponentsAndroid
Labelsmodule_tableviewrow, qe-testadded, supportTeam
ReporterDavide Cassenti
AssigneeHieu Pham
Created2014-02-21T15:35:42.000+0000
Updated2014-04-16T08:52:43.000+0000

Description

Problem description

Adding a 'longclick' event listener to a TableView will also fire the 'click' event if the row inside the TableView has a child view.

Steps to reproduce

1. Use the code below 2. Click on the row: 'click' is fired 3. Long-click on the row: 'longclick' is fired, but also 'click'
var win = Ti.UI.createWindow({ backgroundColor: 'white' });
var table = Ti.UI.createTableView({ minRowHeight : 40 });
var row = Ti.UI.createTableViewRow({
    className: 'row',
    touchEnabled: true,
    height: 200
});

var view = Ti.UI.createView({width:Ti.UI.SIZE,height:Ti.UI.FILL});
row.add(view);
table.setData([row]);

table.addEventListener('longclick', function(e) {
    alert("LONG CLICKED");
});

table.addEventListener('click',function(e) {
	alert("CLICKED");
});

win.add(table);
win.open();

Comments

  1. Hieu Pham 2014-03-17

    master PR: https://github.com/appcelerator/titanium_mobile/pull/5488
  2. Satyam Sekhri 2014-04-16

    Click event does not fire with Longclick event. Verified on: OSX: 10.9.2 SDK: 3.3.0.v20140414214115 Appc Studio: 3.2.3.201404111117 CLI:3.2.3-alpha3 Android Device: Nexus5 (v4.4.2)

JSON Source