Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11684] iOS: TabGroup - TabGroup focus event is not fired when setActiveTab is called on the first tab for the first time

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-12-04T21:59:38.000+0000
Affected Version/sRelease 3.0.0
Fix Version/s2012 Sprint 25, 2012 Sprint 25 API
ComponentsiOS
Labelsqe-ios100112
ReporterAnshu Mittal
AssigneeVishal Duggal
Created2012-11-07T06:05:49.000+0000
Updated2014-06-19T12:44:16.000+0000

Description

TabGroup focus event is not fired when setActiveTab is called on the first tab for the first time. This is not regression since the issue occurs as far as 2.1.2 GA as well. Steps to reproduce: 1. Create an app with the code below. 2. Launch the app and see the logs. Expected: Log message should be printed for the first time also. Actual behavior: Log is not printed.
var win1 = Ti.UI.createWindow({
    title: 'Win 1'
});
    
var tab1 = Ti.UI.createTab({ 
    icon: 'KS_nav_ui.png',
    title: 'Tab 1',
    window: win1
});
    
var win2 = Ti.UI.createWindow({
    title: 'Win 2'
});
    
var tab2 = Ti.UI.createTab({ 
    icon: 'KS_nav_views.png',
    title: 'Tab 2',
    window: win2
});
   
var tabGroup = Ti.UI.createTabGroup({
       
});
            
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
tabGroup.setActiveTab(tab1);
tabGroup.open();
tabGroup.addEventListener('focus', function(e) {
    Ti.API.info('--------------------Focus tab index: ' + e.index);
});


Comments

  1. Vishal Duggal 2012-12-04

    focus and open event handlers for top level containers (window, tabgroup) must be defined before open is called on the container.
  2. Anshu Mittal 2013-03-13

    closing as the bug is invalid

JSON Source