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

iOS: Window focus/blur events do not fire after animating the navigation window

    Details

      Description

      After my app refactoring to use navigationWindow instead navGroup, all the focus/blur events on the windows inside the navigationWindow stopped to fire up, after doing alot tests, i think i found what is causing the problem...

      on my app theres 2 active window on the screen one window is the sideMenu thats stays behind and the other is the navigationWindow, with this setup the events dosent fireup like i described, but when i remove the sideMenu window all the events starts to fire up as usual

      so when theres 2 top level windows(window, navigationWindow) on the screen the views inside navigationWindow dosent got focus/blur events fired up, on the moment theres only one window, all backs to normal

      var height = Ti.Platform.displayCaps.platformHeight;
      var width = Ti.Platform.displayCaps.platformWidth;
      var isToggled = false;
       
      var win = Ti.UI.createWindow({ width : width, height : height, backgroundColor : "pink" });
       
      var nextWin = Ti.UI.createWindow({ width : width, height : height, backgroundColor : "blue" });
       
      var buttonNext = Ti.UI.createButton({ title : "next window" });
       
      var buttonMenu = Ti.UI.createButton({ title : "MENU", top : 60, left : 10 });
       
      win.add(buttonMenu);
      win.add(buttonNext);
       
      var navigation = Titanium.UI.iOS.createNavigationWindow({ backgroundColor : 'grey', window : win, width : width, height : height, });
       
      win.addEventListener('focus', function() { Ti.API.log("win focus"); });
       
      nextWin.addEventListener('focus', function() { Ti.API.log("next win focus"); });
       
      buttonNext.addEventListener('click', function() { navigation.openWindow(nextWin); });
       
      buttonMenu.addEventListener('click', function() { toggleMenu(); });
       
      var animateLeft = Ti.UI.createAnimation({ left : 180, curve : Ti.UI.ANIMATION_CURVE_EASE_OUT, duration : 500 });
      var animateRight = Ti.UI.createAnimation({ left : 0, curve : Ti.UI.ANIMATION_CURVE_EASE_OUT, duration : 500 });
       
      var toggleMenu = function() {
      if (!isToggled) { navigation.animate(animateLeft); isToggled = true; } else { navigation.animate(animateRight); isToggled = false; }
      };
       
      navigation.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emerriman Eric Merriman
                Reporter:
                felipemathies Felipe Mathies
              • Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration