[TIMOB-1906] Android: Event Source Gets Reset
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:57:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, defect |
Reporter | Don Thorp |
Assignee | Don Thorp |
Created | 2011-04-15T03:05:16.000+0000 |
Updated | 2011-04-17T01:57:30.000+0000 |
Description
When an event is fired in a child and propagated up the tree, the source is getting set to the proxy that's firing it and does not preserve the initial source.
See http://developer.appcelerator.com/helpdesk/view/45061">Helpdesk 45061
var w = Ti.UI.createWindow({ backgroundColor : 'blue' , name : 'w'});
w.addEventListener('focus', function(e) {
Ti.API.info("Window Focus: " + e.type + " " + e.source + " " + e.source.name);
});
var b = Ti.UI.createButton({ title : 'Click Me', width : 100, height : 50 , top : 20, name : 'b'});
b.addEventListener('focus', function(e) {
Ti.API.info("Button Focus: " + e.type + " " + e.source + " " + e.source.name);
});
var b1 = Ti.UI.createButton({ title : 'Click Me', width : 100, height : 50, top : 90, name : 'b1' });
b1.addEventListener('focus', function(e) {
Ti.API.info("Button 1 Focus: " + e.type + " " + e.source + " " + e.source.name);
});
w.add(b);
w.add(b1);
w.open({ animated : false});
http://img.skitch.com/20100924-xt69d7yk3s5n5w81rfrapamgp6.png" alt="screenshot">
(from [66b7aa975c491b00c7c58e0aa97a95b41d183e4f]) [#1906 state:fixed-in-qa] the problem was that if a null event object was passed, it wasn't being created at the initial fireEvent location. Therefore each proxy was creating its own event object and setting itself as the source. Some view event's like 'click' set the source explicitly so masked the underlying problem. http://github.com/appcelerator/titanium_mobile/commit/66b7aa975c491b00c7c58e0aa97a95b41d183e4f"> http://github.com/appcelerator/titanium_mobile/commit/66b7aa975c491...
thanks for the screenshot :)
closed against 1.6 G1 and a sim running 2.2