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

Android:Tabgroup:Focus event for a tab is showing wrong source name.

    Details

      Description

      This is a regression.It works fine with 2.0.2.
      Focus event fired for tab 1 is giving 'e.source.name=tab 2'
      Please find logs attached for 2.0.2 and 2.1.0.

      Steps to reproduce
      1) Use the code below

      var tabGroup = Ti.UI.createTabGroup({
      	name:"tabgroup"
      });
       
      var win1 = Ti.UI.createWindow({
      	name: "win 1"
      });
      var tab1 = Ti.UI.createTab({
      	name: "Tab 1",
      	title:'Tab 1',
      	window:win1
      });
       
      var win2 = Ti.UI.createWindow({
      	name: "win 2",
      	title:'Tab 2',
      	backgroundColor:'#fff'
      });
      var tab2 = Ti.UI.createTab({
      	name: "Tab 2",
      	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();
      

      2) Run the app
      3) Tap on tab 2
      4) Tap on tab 1

      Actual result:
      2) After step 2,the following appears in the console/logcat:
      I/TiAPI (10430): -------------> win1 focus event fired! - win 1
      I/TiAPI (10430): -------------> tab1 focus event fired! - Tab 1
      I/TiAPI (10430): -------------> tabGroup focus event fired! - Tab 1

      3) After step 3,the following appears in the console/logcat:
      I/TiAPI (10430): **************> win1 blur event fired! - win 1
      I/TiAPI (10430): -------------> win2 focus event fired! - win 2
      I/TiAPI (10430): **************> tab1 blur event fired! - Tab 1
      I/TiAPI (10430): -------------> tab2 focus event fired! - Tab 1
      I/TiAPI (10430): -------------> tabGroup focus event fired! - Tab 1

      4) After step 4,the following appears in the console/logcat:
      I/TiAPI (10430): **************> win2 blur event fired! - win 2
      I/TiAPI (10430): -------------> win1 focus event fired! - win 1
      I/TiAPI (10430): **************> tab2 blur event fired! - Tab 2
      I/TiAPI (10430): -------------> tab1 focus event fired! - Tab 2
      I/TiAPI (10430): -------------> tabGroup focus event fired! - Tab 2

      Expected result
      2) After step 2,the following appears in the console/logcat:
      -------------> tab1 focus event fired! - Tab 1
      -------------> tabGroup focus event fired! - Tab 1
      -------------> win1 focus event fired! - win 1

      3) After step 3,the following appears in the console/logcat:
      I/TiAPI (10262): **************> tab1 blur event fired! - Tab 1
      I/TiAPI (10262): **************> win1 blur event fired! - win 1
      I/TiAPI (10262): -------------> tab2 focus event fired! - Tab 2
      I/TiAPI (10262): -------------> tabGroup focus event fired! - Tab 2
      I/TiAPI (10262): -------------> win2 focus event fired! - win 2

      4) After step 4,the following appears in the console/logcat:
      I/TiAPI (10262): **************> tab2 blur event fired! - Tab 2
      I/TiAPI (10262): **************> win2 blur event fired! - win 2
      I/TiAPI (10262): -------------> tab1 focus event fired! - Tab 1
      I/TiAPI (10262): -------------> tabGroup focus event fired! - Tab 1
      I/TiAPI (10262): -------------> win1 focus event fired! - win 1

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joshroesslein Josh Roesslein
                Reporter:
                sbhadauria Shyam Bhadauria
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code