Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3341] iOS: navGroup closing window turns black before animation

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-10-27T15:46:16.000+0000
Affected Version/sRelease 1.6.0
Fix Version/sSprint 2011-26, Release 1.8.0
ComponentsiOS
Labelsdefect, ios, reported-1.5.1, reported-1.6.0, rplist
ReporterJon Alter
AssigneeSabil Rahim
Created2011-04-15T03:42:30.000+0000
Updated2011-10-27T15:46:16.000+0000

Description

When you have a navGroup and open a new window using it and then close the window using the navGroup the window turns black before the navGroup goes back. If you click the back button the window does not turn black before the navGroup goes back to the previous page.

Step 1: launch the sample code below
Step 2: tap the red window to open the blue window
Step 3: click the 'close' button on the blue window to go back to the red one
Step 4: notice that the blue window turns black before the slide animation back to the red window
Step 5: click on the red window again
Step 6: tap the left nav button
Step 7: notice that the blue window does not turn black before going back to the red window

app.js

var win = Titanium.UI.createWindow();

var win1 = Titanium.UI.createWindow({
    backgroundColor:"red",
    title:"Red Window"
});
win1.addEventListener('click', function(){
    nav.open(toolsWindow);
});

var nav = Titanium.UI.iPhone.createNavigationGroup({
   window: win1
});

var toolsWindow = Ti.UI.createWindow({
    title: 'Blue Window',
    url: 'tools_window.js',
    nav: nav,
    exitOnClose: false,
    backgroundColor: 'blue'
});

win.add(nav);
win.open();

tools_window.js

var win = Ti.UI.currentWindow;

var button = Ti.UI.createButton({
    title: 'close',
    height: 40,
    width: 300,

});
button.addEventListener('click', function(e) {
    Ti.API.info('clicked close');
    win.nav.close(win);
});

win.add(button);

Tested on

TiSDK 1.5.1, 1.6.0, iOS SDK 4.2

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/76439">http://developer.appcelerator.com/helpdesk/view/76439

Comments

  1. Pedro Enrique 2011-05-18

    Similar thing happens in a tabgroup. Replace the app.js code from above with this one:
       
       var tabgroup = Ti.UI.createTabGroup();
       
       var win1 = Titanium.UI.createWindow({
           backgroundColor:"red",
           title:"Red Window"
       });
       var tab = Ti.UI.createTab({
       	window: win1
       });
       
       win1.addEventListener('click', function(){
        	var toolsWindow = Ti.UI.createWindow({
       	    title: 'Blue Window',
       	    url: 'd.js',
       	    nav: tab,
       	    exitOnClose: false,
       	    backgroundColor: 'blue'
       	});
          tab.open(toolsWindow);
       });
       
       tabgroup.addTab(tab);
       tabgroup.open();
       
    When closing the next window with the custom button, the window does animate to the side and closes, but the navBar elements stay in their place instead of sliding over with the window the way they would by pressing the built in back button. This bug seems related, that's why I'm not opening a separate ticket for it. Helpdesk ticket: http://support.appcelerator.com/tickets/APP-218955/homepage
  2. Sabil Rahim 2011-06-28

    https://github.com/appcelerator/titanium_mobile/pull/169 the pull request associated with it
  3. Sabil Rahim 2011-06-28

    Its been merged and was cherry picked into 1.7.x
  4. Vikramjeet Singh 2011-08-29

    Tested On: Mac OSX Lion TiMob: 1.8.0v20110819142548 TiStud: 1.0.4.201108101535 Devices: iPhone4 version 4.2.10 iPad2 version 4.3.5 iPod 3

JSON Source