Opened 9 years ago

Closed 9 years ago

#11690 closed defect (fixed)

StackContainer: nested StackContainers with doLayout=false not visible

Reported by: ffilozov Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit Version: 1.5
Keywords: StackContainer nest Cc: Kenneth G. Franqueiro
Blocked By: Blocking:

Description

Nesting StackContainers? causes only the outermost StackContainer? to be visible, and also the first child of the outermost StackContainer?. The other nested StackContainers? are not visible.

Test case:

...
<body>
    <div id="stack1" dojoType="dijit.layout.StackContainer" doLayout="false">
        <div id="stack2" dojoType="dijit.layout.StackContainer" doLayout="false">
            <div id="stack3" dojoType="dijit.layout.StackContainer" doLayout="false">
                <div id="stack4" dojoType="dijit.layout.StackContainer" doLayout="false">
                    <input id="foo" type="button"/>
                </div>
            </div>
        </div>
    </div>
<body>
...

I posted my observations to the Dojo-Interest mailing list:

"I ... traced it to the layout() function inside StackContainer?. After startup() has been called on all the dijits, stack1.resize() is called. This causes stack2 to become visible, since stack2 is the first child and selected by default. Then stack1.layout() is called. At this point, because of doLayout being "false", stack1.layout() returns without calling stack2.resize(). Therefore, stack2's first child never becomes visible, and resize() is never called on subsequent StackContainers?.

Looking at TabContainer?'s layout(), I've noticed that there's an alternative path for when doLayout is "false". It simply calls resize() on its selected child."

Browser: Firefox

Version: 3.6.8

OS: Ubuntu 10.04 LTS (kernel 2.6.32-24-generic-pae)

Attachments (1)

11690.patch (674 bytes) - added by Kenneth G. Franqueiro 9 years ago.
Just ran into the same issue today; here's a patch that's essentially what we did to work around it. It really ends up matching the code in _transition anyway.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by bill

Summary: Nested StackContainersStackContainer: nested StackContainers with doLayout=false not visible

Changed 9 years ago by Kenneth G. Franqueiro

Attachment: 11690.patch added

Just ran into the same issue today; here's a patch that's essentially what we did to work around it. It really ends up matching the code in _transition anyway.

comment:2 Changed 9 years ago by bill

Cc: Kenneth G. Franqueiro added

Patch makes sense, we should just have a testcase for it. If you have a test case feel free to check your patch in.

comment:3 Changed 9 years ago by bill

Milestone: tbd1.7
Owner: set to bill

See also #12687, duplicate ticket.

comment:4 Changed 9 years ago by bill

Resolution: fixed
Status: newclosed

(In [24449]) Fix from kgf for missing resize() call on nested StackContainers with doLayout=false, fixes #11690 !strict.

Note: See TracTickets for help on using tickets.