Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5351] iOS: A Tab Bar's Child's rightNavButton Can Get Placed on Parent

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2011-09-25T09:45:57.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-38, Release 1.8.0
ComponentsiOS
Labelsbranch-5062, module_tabgroup, qe-testadded, rightnavbutton, tabgroup
ReporterDawson Toth
AssigneeBlain Hamon
Created2011-09-23T02:10:40.000+0000
Updated2014-06-19T12:46:36.000+0000

Description

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.

Attachments

FileDateSize
timob-5351.png2011-09-24T02:28:54.000+000027833

Comments

  1. Dawson Toth 2011-09-24

    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).
  2. Dawson Toth 2011-09-25

    I am no longer able to reproduce; looks good to me!
  3. Dustin Hyde 2011-12-09

    Bug fixed. Verified on: SDK: 1.8.0.1.v20111209145039 Studio: 1.0.7.201112080131 OS: OS X Lion Devices Tested: iPad 4.3

JSON Source