Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8038] MobileWeb: View - Touch events of a child view are being reported as touches for the parent

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-19T22:29:12.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsMobileWeb
Labelsqe-mw020912, qe-port
ReporterMichael Pettiford
AssigneeBryan Hughes
Created2012-03-15T12:55:27.000+0000
Updated2012-08-15T16:03:31.000+0000

Description

Steps to reproduce 1. Create a default mobile web app and change the app.js code to the following
		var _window = Titanium.UI.createWindow({
			title : 'test',
			backgroundColor : 'white'
		});


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

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

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

		sampleParentView.addEventListener('touchstart', parentEventHandler);
        sampleParentView.add(sampleChildView);
        
        _window.add(sampleParentView);
_window.open();
2. Run app 3. Touch the red square Actual result: The alert is displayed with "parent received TOUCHSTART event. Source parent" Expected result: The alert is displayed with "parent received TOUCHSTART event. Source child" *Note the linked ticket"

Comments

  1. Bryan Hughes 2012-03-19

    FYI the linked ticket was not related. We listen to touch events on all nodes, whether or not an event listener is attached.
  2. Bryan Hughes 2012-03-19

    Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1745
  3. Bryan Hughes 2012-03-19

    Updated Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1758
  4. Lokesh Choudhary 2012-08-15

    Verified fix on: Titanium studio : 2.1.1.201207271312 SDK version : 2.2.0.v20120814134112 Android 4.0.4 - default ,chrome 18.0 , firefox 14.0.1 Iphone 5.1.1 - safari mobile Mountain lion(10.8) - chrome 21.0,safari 6,firefox 14.0.1

JSON Source