#1957 closed defect (fixed)
LayoutContainer + TabContainer = strange problem
Reported by: | joose | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Widgets | Version: | 0.4 |
Keywords: | LayoutContainer, TabContainer | Cc: | |
Blocked By: | Blocking: |
Description
Problem: When I have complex layout, when destroying Tab, it causes error in src/widget/html/layout.js
Cause: unknown
Solution:
--- src/widget/html/layout.js (revision 6640) +++ src/widget/html/layout.js (working copy) @@ -16,7 +16,6 @@ * children: * an array like [ {domNode: foo, layoutAlign: "bottom" }, {domNode: bar, layoutAlign: "client"} ] */ - dojo.html.addClass(container, "dojoLayoutContainer"); // Copy children array and remove elements w/out layout. @@ -60,6 +59,7 @@ var elm=child.domNode; var pos=child.layoutAlign; // set elem to upper left corner of unused space; may move it later + if (elm == null) {return; } with(elm.style){ left = f.left+"px"; top = f.top+"px";
Attachments (1)
Change History (10)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
I think Alex means, "Is this a dup of #1952?". You said there that it's a different bug. Hmm, I can't really check in this code. It's a workaround to a problem in another piece of code; I want to fix the original code.
comment:3 Changed 16 years ago by
comment:4 Changed 16 years ago by
Ok, I attached a test-case which reproduces the bug.
How to do it: close the tab
Changed 16 years ago by
Attachment: | test-tabs9.html added |
---|
Test to reproduce the bug (not optimized)
comment:5 Changed 16 years ago by
And forgot to say this: the src/widget/html/layout.js is called from LayoutContainer?.js
comment:6 Changed 16 years ago by
comment:7 Changed 16 years ago by
This happens because calling childWidget.destroy() deletes childWidget.domNode (and other resources the child is using), but the child is still listed in the parent's this.children[] array. (The above fix just masks the problem.)
comment:8 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
joose: is this a dupe of #1957?