Problem
In certain situations with a tab group, a child window's rightNavButton can get placed on its parent. Specifically: a table view opens a child on the tab stack, at the same time the user hits the back button to return to the parent.
Reproduction
1. Drop the following in an app.js. The app is structured as an outer, middle, and inner window.
2. Tap "Open Middle", then "I Am Middle, Click to Open Inner". Notice what each of the three windows should look like, particularly the nav bar.
3. Tap "I Am Middle" in the top left to go back to the middle window.
4. Hold down on "I Am Outer" and "I Am Middle, Click to Open Inner".
5. Let go of both at the same time.
6. If your timing is right, the nav bar will say "I Am Inner" and "Do Nothing", and there will be a label in the middle of the screen saying, "I Am Outer" (see the attached screenshot). There is also an invisible button in the top left "I Am Outer" (tap the top left, and you'll see it animate away and we'll magically be on the outer window).
7. If your timing isn't right, you'll be brought to the outer or inner windows. Navigate back to the middle window, and go back to step 4. I am able to reproduce this 3 out of 4 times.
var tabGroup = Ti.UI.createTabGroup();
var outer = Ti.UI.createWindow({
title: 'I Am Outer',
rightNavButton: Ti.UI.createButton({ title: 'Open Middle' }),
backgroundColor: '#fff'
});
outer.add(Ti.UI.createLabel({ text: 'I Am Outer' }));
var tab = Ti.UI.createTab({
window: outer
});
tabGroup.addTab(tab);
outer.rightNavButton.addEventListener('click', function() {
var middle = Ti.UI.createWindow({
title: 'I Am Middle',
backgroundColor: '#fff'
});
var table = Ti.UI.createTableView({
data: [
{ title: 'I Am Middle, Click to Open Inner' }
]
});
table.addEventListener('click', function() {
var inner = Ti.UI.createWindow({
title: 'I Am Inner',
rightNavButton: Ti.UI.createButton({ title: 'Do Nothing' }),
backgroundColor: '#fff'
});
inner.add(Ti.UI.createLabel({ text: 'I Am Inner' }));
tab.open(inner);
});
middle.add(table);
tab.open(middle);
});
tabGroup.open();
Error Log
Nothing shows up in the log about this. The only manifestation is the nav button being on the wrong window.
I have added a discrete reproduction, steps to reproduce, environment tested in, screenshot, and have updated the problem description. I am still able to reproduce this in 1.8.0 pulled down from CI this morning (see the environment field for details on the precise version).
I am no longer able to reproduce; looks good to me!
Bug fixed. Verified on: SDK: 1.8.0.1.v20111209145039 Studio: 1.0.7.201112080131 OS: OS X Lion Devices Tested: iPad 4.3