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

iOS: TabGroup - Removing the last tab from tabgroup does not refresh the screen.

    Details

      Description

      Removing the last tab from tabgroup does not refresh the screen and continues to show the window and title.

      This is a regression.It works fine on 2.0.2

      Steps to Reproduce:

      1. Install the app on device and launch it.
      2. Click on label Remove Tab 1
      3. Click on label remove tab 2.

      Expected Result:
      After step 2, the Tab 1 should be removed.
      After step 3, the Tab 2 should be removed and a blank screen should be shown.

      Actual Result:
      After step 2, the Tab 1 is removed.
      After step 3, the Tab 2 is removed but the window and title of tab 2 continues to show. Also, a warning is shown in the console.Please find attached the log file.
      On sending the app to the background and reopening it again,it now shows the blank screen.

      app.js

      // create tab group
      var tabGroup = Titanium.UI.createTabGroup();
       
      var win1 = Titanium.UI.createWindow({  
          title:'Tab 1',
          backgroundColor:'#fff'
      });
      var tab1 = Titanium.UI.createTab({  
          icon:'KS_nav_views.png',
          title:'Tab 1',
          window:win1
      });
       
      var label1 = Titanium.UI.createLabel({
          color:'#999',
          text:'Remove Tab1',
          font:{fontSize:20,fontFamily:'Helvetica Neue'},
          textAlign:'center',
          width:'auto'
      });
       
      label1.addEventListener('click', function() {
          tabGroup.removeTab(tab1);
          label1 = win1 = tab1 = null;
      });
       
      win1.add(label1);
       
      var win2 = Titanium.UI.createWindow({  
          title:'Tab 2',
          backgroundColor:'#fff'
      });
      var tab2 = Titanium.UI.createTab({  
          icon:'KS_nav_ui.png',
          title:'Tab 2',
          window:win2
      });
       
      var label2 = Titanium.UI.createLabel({
          color:'#999',
          text:'remove tab2',
          font:{fontSize:20,fontFamily:'Helvetica Neue'},
          textAlign:'center',
          width:'auto'
      });
       
      label2.addEventListener('click', function() {
          tabGroup.removeTab(tab2);
          label2 = win2 = tab2 = null;
      });
       
      win2.add(label2);
       
      //  add tabs
       
      tabGroup.addTab(tab1);  
      tabGroup.addTab(tab2);  
       
      // open tab group
      tabGroup.open();
      

        Attachments

          Activity

            People

            • Assignee:
              ngupta Neeraj Gupta
              Reporter:
              nchhabra Neha Chhabra
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration