Opened 12 years ago

Closed 12 years ago

#4582 closed defect (fixed)

Bug in tab closing

Reported by: guest Owned by: anonymous
Priority: high Milestone:
Component: General Version: 0.4.2
Keywords: Cc:
Blocked By: Blocking:

Description

This is a bug I have noticed when using the keyboard navigation.

When a tab is closed in the tab container, the tab controller does not remove the corresponding tab button from its child list. When using keyboard navigation to switch between tabs in the tab container, the tab controller navigates through this child list, and when reaching a tab button which corresponded to a destroyed tab, it results in an error since the button (which is now destroyed) is still in the list.

The bug is situated in the PageController? class, in the PageContainer?.js file. The method is onRemoveChild(page).

I suggest to modify it as follows:

onRemoveChild: function(/* Widget */ page){

summary Called whenever a page is removed from the container. Remove the button corresponding to the page. if(this._currentChild == page){ this._currentChild = null; } var button = this.pane2button[page]; if(button){

Start of suggestion this.removeChild(button); End of suggestion button.destroy();

} this.pane2button[page] = null;

}

Change History (2)

comment:1 Changed 12 years ago by Adam Peller

is this a problem in 0.9? Also, please provide contact/CLA info

comment:2 Changed 12 years ago by tk

Resolution: fixed
Status: newclosed

Just tested in trunk, closed tab 3 of first test case with closeable tabs and cycled from tab1->tab2 many times... no errors

Corresponding StackContainer? code:

	closeChild: function(/*Widget*/ page){
		// summary
		//	callback when user clicks the [X] to remove a page
		//	if onClose() returns true then remove and destroy the childd
		var remove = page.onClose(this, page);
		if(remove){
			this.removeChild(page);
			// makes sure we can clean up executeScripts in ContentPane onUnLoad
			page.destroy();
		}
	},

Children are definately removed and destroyed

Closing for 1.0

-Karl

Note: See TracTickets for help on using tickets.