GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-08-07T21:45:56.000+0000 |
Affected Version/s | Release 1.8.2 |
Fix Version/s | Release 2.1.0, Sprint 2012-09 Core, 2013 Sprint 16, 2013 Sprint 16 API, Release 3.1.2, Release 3.2.0 |
Components | Android |
Labels | SupportTeam, core, module_tabgroup, parity, qe-testadded, regression |
Reporter | Federico Casali |
Assignee | Ping Wang |
Created | 2012-04-13T01:07:59.000+0000 |
Updated | 2013-08-08T10:56:38.000+0000 |
Problem description
'Focus' events might not correctly handled when associated to a window set in tabGroup and with the url property
Steps to reproduce
Steps
- Create a tabGroup with 2 windows.
- Set the url property for each window and define 'focus' event listener in the two 'win1.js' and 'win2.js' files.
- Don't set event listeners in the app.js
Result: 'focus' event listeners ae not triggered on Android (on iOS works fine).
Code
// app.js
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
url:'win1.js'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Win 1',
window:win1
});
var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff',
url:'win2.js'
});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Win 2',
window:win2
});
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.open();
// win1.js
var win1 = Ti.UI.currentWindow;
win1.addEventListener('focus',function(e){
alert('test win1');
});
// win2.js
var win2 = Ti.UI.currentWindow;
win2.addEventListener('focus',function(e){
alert('test win2');
});
Additional notes:
Customer ticket :
http://support-admin.appcelerator.com/display/APP-221687/conversation/read_all
Just verified that this is already fixed in master, but was still present in 2.0.1GA2. It was likely fixed as a result of https://github.com/appcelerator/titanium_mobile/pull/2069.
Closing as fixed with SDK 2.1.0.v20120618154152.
This is regression. events are fired correctly in 3.1.1GA Verified with: Studio: 3.1.2.201308021524 SDK: 3.1.2.v20130806104555 acs:1.0.5 alloy:1.2.0-alpha6 titanium:3.1.2-alpha titanium-code-processor:1.0.2-alpha OS: OSX 10.8.4 Device: nexus 7(v4.3) Xcode:4.6.3 No alert is being displayed.
PR: https://github.com/appcelerator/titanium_mobile/pull/4553 3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4554
Verified with: Studio: 3.1.2.201308071912 SDK: 3.1.2.v20130807171139 acs:1.0.5 alloy:1.2.0-alpha6 titanium:3.1.2-alpha titanium-code-processor:1.0.2-alpha OS: OSX 10.8.4 Device: nexus 7(v4.3) Xcode:4.6.3 focus events working fine for windows in a tabGroup.