Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17656

iOS: Open event for window on first tab of tab group fires when it shouldn't

    Details

    • Type: Bug
    • Status: Open
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: Release 3.4.0
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Environment:

      Description

      This is not a regression as its happen on SDK 3.3.0.GA build.

      1. Run the below code.

      Actual Result - Active tab on launch is tab 2 but open events are fired first for win 1 & second for win 2

      Expected Result - On launch the active tab must be tab2 & only win2 open event must be fired.

      Additional Info - It works fine on Android. See the issue TIMOB-8222

      Titanium.UI.setBackgroundColor('#000');
      var tabGroup = Titanium.UI.createTabGroup();
      // create base UI tab and root window
      //
      var win1 = Titanium.UI.createWindow({
      	title : 'Tab 1',
      	backgroundColor : '#fff'
      });
       
      win1.addEventListener('open', function() {
      	alert('win1 open event fired');
      });
       
      var tab1 = Titanium.UI.createTab({
      	icon : 'KS_nav_views.png',
      	title : 'Tab 1',
      	window : win1
      });
       
      var label1 = Titanium.UI.createLabel({
      	color : '#999',
      	text : 'I am Window 1',
      	font : {
      		fontSize : 20,
      		fontFamily : 'Helvetica Neue'
      	},
      	textAlign : 'center',
      	width : 'auto'
      });
       
      win1.add(label1);
       
      //
      // create controls tab and root window
      //
      var win2 = Titanium.UI.createWindow({
      	title : 'Tab 2',
      	backgroundColor : '#fff'
      });
       
      win2.addEventListener('open', function() {
      	alert('win2 open event fired');
      });
       
      var tab2 = Titanium.UI.createTab({
      	icon : 'KS_nav_ui.png',
      	title : 'Tab 2',
      	window : win2
      });
       
      var label2 = Titanium.UI.createLabel({
      	color : '#999',
      	text : 'I am Window 2',
      	font : {
      		fontSize : 20,
      		fontFamily : 'Helvetica Neue'
      	},
      	textAlign : 'center',
      	width : 'auto'
      });
       
      win2.add(label2);
       
      //
      // add tabs
      //
      tabGroup.addTab(tab1);
      tabGroup.addTab(tab2);
       
      tabGroup.setActiveTab(1);
      alert(tabGroup.getActiveTab());
      // open tab group
      tabGroup.open(); 
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                djha Dhirendra Jha
                Tester:
                Dustin Hyde
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-19179
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration