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

iOS: Window focus event is not triggered when switch back from another tab

    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
    • Environment:

      Titanium SDK: 3.5.0.v20141121153314
      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)

    • Sprint:
      2014 Sprint 24 SDK

      Description

      Window Focus Event is not triggered when we switch between tabs in iOS device.
      For Android, It works fine.

      This is a regression since it doesn't occur in SDK 3.4.1 GA

      Steps To Reproduce

      1. Create a default titanium classic project
      2. Insert following code in your app.js file

      win1.addEventListener('focus', function(){
      	alert('focused!');
      });
      

      3. Run the app in iOS device
      4. Switch between tab 1 and tab 2

      Expected Result

      An alert should appear with text "focused!"

      Actual Result

      Alert does not appear with SDK version 3.5.0

      Tested app.js file

      // this sets the background color of the master UIView (when there are no windows/tab groups on it)
      Titanium.UI.setBackgroundColor('#000');
       
      // create tab group
      var tabGroup = Titanium.UI.createTabGroup();
       
       
      //
      // create base UI tab and root window
      //
      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:'I am Window 1',
      	font:{fontSize:20,fontFamily:'Helvetica Neue'},
      	textAlign:'center',
      	width:'auto'
      });
       
      win1.add(label1);
      win1.addEventListener('focus', function(){
      		    alert('focused!');
      		});
       
      //
      // create controls tab and root window
      //
      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:'I am Window 2',
      	font:{fontSize:20,fontFamily:'Helvetica Neue'},
      	textAlign:'center',
      	width:'auto'
      });
      win2.add(label2);
       
      tabGroup.addTab(tab1);  
      tabGroup.addTab(tab2);  
       
      tabGroup.open();
      

        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-19394
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration