Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8728] Android : Titanium.UI.View: V8 and Rhino - Touch event is being fired from parent instead of child.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-03-02T10:57:39.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 3.0.2
ComponentsAndroid
Labelscore, qe-and040912
ReporterAnshu Mittal
Assigneejithinpv
Created2012-03-24T10:05:29.000+0000
Updated2017-03-17T18:37:21.000+0000

Description

TOUCHSTART event is being fired on parent instead of child. *Not a regression, the behavior exists as far back as 1.8.2 at least* Steps to reproduce: 1. Run the sample code below

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

function parentEventHandler(e) {
			Ti.API.info('parent received ' + e.type.toUpperCase() + ' event. Source: ' + e.source.id);
		}

		var sampleParentView = Ti.UI.createView({
			bottom : 0,
			width : 150,
			height : 150,
			backgroundColor : 'yellow',
			id : 'parent'
		});

		var sampleChildView = Ti.UI.createView({
			width : 100,
			height : 100,
			backgroundColor : 'red',
			id : 'child'
		});

		sampleParentView.addEventListener('touchstart', parentEventHandler);
        sampleParentView.add(sampleChildView);
        
        window.add(sampleParentView);
window.open();
2. Press the red box. Expected result In the console the output should show "parent received TOUCHSTART event. Source: child". Actual result The console displayed the output "parent received TOUCHSTART event. Source: parent"

Comments

  1. jithinpv 2013-03-02

    Issue does not reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Android Emulator: Android SDK version: 2.2
  2. Lee Morris 2017-03-17

    Closing ticket as the issue cannot be reproduced.

JSON Source