Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2283] Android: Longclick event doesn't work inside a ScrollView

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-07-09T18:05:23.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsevent, eventlistener, events, longclick,, scrollview
ReporterFokke Zandbergen
AssigneeDaniel Sefton
Created2013-07-04T11:21:35.000+0000
Updated2016-03-08T07:41:17.000+0000

Description

The following doesn't work, while longpress does:
var window = Ti.UI.createWindow({
	backgroundColor : 'white'
});
var scrollView = Ti.UI.createScrollView({
	backgroundColor : 'blue'
});

var view = Ti.UI.createView({
	height : 100,
	backgroundColor : 'red'
});
view.addEventListener('longclick', function() {
	alert('hello world');
});

scrollView.add(view);
window.add(scrollView);

window.open();

Comments

  1. Daniel Sefton 2013-07-09

    Cannot reproduce on Samsung Galaxy S2 2.3.6 with Ti SDK 3.1.1 GA. The longclick event fires as expected, both inside and outside a scrollview.
  2. Fokke Zandbergen 2013-07-09

    Totally missed it was an Android-only event. Sorry for not including the device OS in the environment, or better... read the docs better. Close it.

JSON Source