[TIMOB-8728] Android : Titanium.UI.View: V8 and Rhino - Touch event is being fired from parent instead of child.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-03-02T10:57:39.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | Release 3.0.2 |
Components | Android |
Labels | core, qe-and040912 |
Reporter | Anshu Mittal |
Assignee | jithinpv |
Created | 2012-03-24T10:05:29.000+0000 |
Updated | 2017-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"
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
Closing ticket as the issue cannot be reproduced.