[TIMOB-824] Parent events fired when child view has same event callback
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Stephen Tramer |
Assignee | Blain Hamon |
Created | 2011-04-15T02:37:15.000+0000 |
Updated | 2011-04-17T01:54:21.000+0000 |
Description
Sample code:
var w = Ti.UI.createWindow();
var v1 = Ti.UI.createView({
top:10,
left:10,
right:10,
bottom:10,
backgroundColor:'#ff0000'
});
v1.addEventListener('touchstart', function() {
Ti.API.info('Touched view 1');
});
var v2 = Ti.UI.createView({
top:50,
left:50,
right:50,
bottom:50,
backgroundColor:'#00ff00'
});
v2.addEventListener('touchstart', function() {
Ti.API.info('Touched view 2');
});
v1.add(v2);
w.add(v1);
w.open();
Click in the second view and you'll see both the events for v1 and v2 are fired. This may cause problems in some situations; maybe add a 'propagatesEvents' flag?
(from [466f3e41d7e648145f5166c451b5820db51fef04]) Closes #824: Events are no longer propagated beyond the first view which has a listener for them. http://github.com/appcelerator/titanium_mobile/commit/466f3e41d7e648145f5166c451b5820db51fef04"> http://github.com/appcelerator/titanium_mobile/commit/466f3e41d7e64...