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

iOS: Tab doesn't fire FOCUS event when switching while TabGroup is inside a TableView

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 3.5.0
    • Fix Version/s: Release 3.5.0, Release 4.0.0
    • Component/s: iOS
    • Labels:
    • Environment:

      Titanium SDK: 3.5.0.v20141208122514
      Appc-Studio: 3.4.1 GA
      Titanium CLI: 3.4.1 GA
      Alloy : 1.5.1 GA
      Xcode : 6.1
      OS: OSX 10.10.1
      Device : iPhone 6plus (iOS 8.1)

    • Story Points:
      8
    • Sprint:
      2014 Sprint 25 SDK

      Description

      First Tab of a TabGroup is not firing FOCUS event when switching between tabs while the TabGroup is inside a TableView.

      Steps To Reproduce

      1. Create a classic app using following code

      // this sets the background color of the master UIView (when there are no windows/tab groups on it)
      Titanium.UI.setBackgroundColor('#000');
       
      var tbl_data = [
      	{title:'Row 1'},
      	{title:'Row 2'},
      	{title:'Row 3'}
      ];
       
      var table = Titanium.UI.createTableView({
      	data:tbl_data
      });
       
      table.addEventListener('click', function(event) {
      	
      	var tabGroup = Titanium.UI.createTabGroup();
       
      	var win1 = Titanium.UI.createWindow({  
      		name:'win1',
          	title:'Tab 1',
          	backgroundColor:'#fff'
      	});
      	var tab1 = Titanium.UI.createTab({  
      		name:'tab1',
      	    icon:'KS_nav_views.png',
         		title:'Tab 1',
          	window:win1
      	});
       
      	var win2 = Titanium.UI.createWindow({  
      		name:'win2',
          	title:'Tab 2',
          	backgroundColor:'#fff'
      	});
      	var tab2 = Titanium.UI.createTab({ 
      		name:'tab2', 
          	icon:'KS_nav_ui.png',
          	title:'Tab 2',
         		window:win2
      	});
       
      	tabGroup.addTab(tab1);  
      	tabGroup.addTab(tab2);  
       
       	tabGroup.addEventListener('focus', function(e) {
       		Ti.API.info('-------------> tabGroup focus event fired! - ' + e.source.name);
       	});
          
       	tab1.addEventListener('focus', function(e) {
              Ti.API.info('-------------> tab1 focus event fired! - ' + e.source.name);
          });
          tab2.addEventListener('focus', function(e) {
              Ti.API.info('-------------> tab2 focus event fired! - ' + e.source.name);
          });
          win1.addEventListener('focus', function(e) {
              Ti.API.info('-------------> win1 focus event fired! - ' + e.source.name);
          });
          win2.addEventListener('focus', function(e) {
              Ti.API.info('-------------> win2 focus event fired! - ' + e.source.name);
          });
       
          tab1.addEventListener('blur', function(e) {
              Ti.API.info('**************> tab1 blur event fired! - ' + e.source.name);
          });
          tab2.addEventListener('blur', function(e) {
              Ti.API.info('**************> tab2 blur event fired! - ' + e.source.name);
          });
          win1.addEventListener('blur', function(e) {
              Ti.API.info('**************> win1 blur event fired! - ' + e.source.name);
          });
          win2.addEventListener('blur', function(e) {
              Ti.API.info('**************> win2 blur event fired! - ' + e.source.name);
          });
          tabGroup.open();
      });
       
       
      table.setData(tbl_data);
      var win = Ti.UI.createWindow();
      win.add(table);
      win.open();
      

      2. Run the app in iOS device
      3. Switch between Tab1 and Tab2 few times

      Actual Result

      Tabs are not triggered focus event properly for every time.
      Following is the console log:

      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> tab1 focus event fired! - tab1
      [INFO] :   -------------> win1 focus event fired! - win1
      [INFO] :   **************> win1 blur event fired! - win1
      [INFO] :   **************> tab1 blur event fired! - tab1
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> tab2 focus event fired! - tab2
      [INFO] :   -------------> win2 focus event fired! - win2
      [INFO] :   **************> win2 blur event fired! - win2
      [INFO] :   **************> tab2 blur event fired! - tab2
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win1 focus event fired! - win1
      [INFO] :   **************> win1 blur event fired! - win1
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win2 focus event fired! - win2
      [INFO] :   -------------> tab2 focus event fired! - tab2
      [INFO] :   **************> win2 blur event fired! - win2
      [INFO] :   **************> tab2 blur event fired! - tab2
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win1 focus event fired! - win1
      [INFO] :   **************> win1 blur event fired! - win1
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win2 focus event fired! - win2
      [INFO] :   **************> win2 blur event fired! - win2
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win1 focus event fired! - win1
      [INFO] :   **************> win1 blur event fired! - win1
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win2 focus event fired! - win2
      [INFO] :   **************> win2 blur event fired! - win2
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win1 focus event fired! - win1
      [INFO] :   **************> win1 blur event fired! - win1
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win2 focus event fired! - win2
      [INFO] :   **************> win2 blur event fired! - win2
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win1 focus event fired! - win1
      [INFO] :   **************> win1 blur event fired! - win1
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> win2 focus event fired! - win2
      

      Expected Result

      Tab focus event should be triggered properly every time.
      Following console log should repeat for every focus event.

      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> tab1 focus event fired! - tab1
      [INFO] :   -------------> win1 focus event fired! - win1
      [INFO] :   **************> win1 blur event fired! - win1
      [INFO] :   **************> tab1 blur event fired! - tab1
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> tab2 focus event fired! - tab2
      [INFO] :   -------------> win2 focus event fired! - win2
      [INFO] :   **************> win2 blur event fired! - win2
      [INFO] :   **************> tab2 blur event fired! - tab2
      [INFO] :   -------------> tabGroup focus event fired! - undefined
      [INFO] :   -------------> tab1 focus event fired! - tab1
      [INFO] :   -------------> win1 focus event fired! - win1
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                kvelummaylum Kajenthiran Velummaylum
                Reviewer:
                Jon Alter
                Tester:
                Wilson Luu (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration