Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15777] iOS: Window focus event not called for the first time when window added on tab group

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-02-03T20:09:31.000+0000
Affected Version/sRelease 3.2.0, Release 3.2.1
Fix Version/s2013 Sprint 24, 2013 Sprint 24 API, Release 3.1.4, Release 3.2.0
ComponentsiOS
Labelsqe-3.2.0, qe-3.2.1, qe-closed-3.2.0, regression, triage
ReporterPriya Agarwal
AssigneeVishal Duggal
Created2013-11-21T10:36:38.000+0000
Updated2017-03-21T21:46:59.000+0000

Description

Window focus event is not called for the first time when app launches. This is not regression occurs for 3.1.3.GA also.
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');
});

Steps to reproduce: 1. Copy paste the code in app.js, win1.js and win2.js. 2. Launch the app. Expected Result: 2. Alert must pop up as "test win1" Actual Result: 2. No alert message pops up. But on clicking tab 2 alert message pop up and after the focus event works fine. This works fine for android. Alert pops up when first time app launches.

Comments

  1. Vishal Duggal 2013-11-21

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5005
  2. Vishal Duggal 2013-11-21

    Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/5006
  3. Samuel Dowse 2013-11-27

    Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311262027 Titanium SDK, build: 3.2.0.v20131126144841 CLI: 3.2.0-beta Alloy: 1.3.0-beta Xcode: 5.0.2 iOS Simulator: iPhone, iPad iOS Device: iPhone 5S (7.0) App successfully builds and installs to device and simulator. When the app is opened win1 popup is opened automatically. Closing.
  4. Priya Agarwal 2014-02-03

    Test Environment: Reopening the issue since not working on latest Build: 3.2.1.v20140130101648 This is a regression as it works fine on 3.2.0.GA Not working on: Appc Studio:3.2.1.201401311225 Sdk:3.2.1.v20140130101648 alloy:1.3.1-cr titanium:3.2.1-beta3 acs:1.0.12 titanium-code-processor:1.1.0 Osx: Maverick 10.9 Xcode:5.0.2 Device:Iphone5c(v7.0.4),Ipod Touch3(v6.1.3)
  5. Vishal Duggal 2014-02-03

    Just tested this with latest 3_2_X and master. Can not reproduce
  6. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source