Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11668] Android: Scrollview does not generate click events

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2013-03-20T05:24:35.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sRelease 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06
ComponentsAndroid
Labelsandroid, clickEvent, exalture, qe-testadded, scrollview
ReporterSoumya Kanti Kar
AssigneeSunila
Created2012-11-02T11:39:04.000+0000
Updated2013-09-25T06:43:23.000+0000

Description

When a scroll view with an other view is added to a window. The Scroll view does not listen to the event. If you click on the view inside scrollview then both the view and scrollview will get the click event, but if you click on just the scroll view, the scrollview is not getting any click event. This issue is happening only in Android. It works properly in iPhone.

Steps to Reproduce:

1. Load the below app.js 2. Click on the red view (The click event of both view and scrollview is getting called) 3. Click on the yellow view (The click event of the scrollview is not getting called) app.js:

var win = Ti.UI.createWindow({
	backgroundColor:'white'
});

var self = Ti.UI.createView({
	left : 0,
	top : 0,
	width : '50%',
	height : '50%',
	backgroundColor : 'red'
});

self.addEventListener('click', function(e) {
	Ti.API.info("View has been clicked");
});

var scrollbar = Ti.UI.createScrollView({
	left : 0,
	top : 0,
	width : '100%',
	height : '100%',
	backgroundColor : 'yellow'
});

scrollbar.addEventListener('click', function(e) {
	Ti.API.info("Scrollbar has been clicked");
});

scrollbar.add(self);


win.add(scrollbar);
win.open();
Tested Devices: HTC Sense Android v2.3.3

Attachments

FileDateSize
zTouchTest.zip2012-11-02T11:39:04.000+0000754747

Comments

  1. Shameer Jan 2013-03-06

    The problem reproduces with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.2.201302191606 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2
  2. Tibor Szasz 2013-03-08

    I can confirm it. Is there a workaround available?
  3. Sunila 2013-03-12

    https://github.com/appcelerator/titanium_mobile/pull/3956
  4. Shyam Bhadauria 2013-03-20

    Environment used for verification - Titanium SDK: 3.1.0.v20130319225749 Titanium  Studio:3.0.2.201302151605 Device: Samsung GALAXY Note (2.3.6),LG-P970 Android 2.2.2 and Nexus 7 Android 4.1

JSON Source