Index: dojo-release-1.3.2-src/dijit/layout/StackContainer.js =================================================================== --- dojo-release-1.3.2-src.orig/dijit/layout/StackContainer.js +++ dojo-release-1.3.2-src/dijit/layout/StackContainer.js @@ -136,14 +136,7 @@ dojo.declare( // every page one by one if(this._beingDestroyed){ return; } - if(this._started){ - // this will notify any tablists to remove a button; do this first because it may affect sizing - dojo.publish(this.id+"-removeChild", [page]); - - // in case the tab titles now take up one line instead of two lines - this.layout(); - } - + // unselect if removing selected page so resize will not be called on it via the below layout call if(this.selectedChildWidget === page){ this.selectedChildWidget = undefined; if(this._started){ @@ -153,6 +146,15 @@ dojo.declare( } } } + + if(this._started){ + // this will notify any tablists to remove a button; do this first because it may affect sizing + dojo.publish(this.id+"-removeChild", [page]); + + // in case the tab titles now take up one line instead of two lines + this.layout(); + } + }, selectChild: function(/*Widget*/ page){