diff --git a/xpfe/global/resources/content/bindings/tabbox.xml b/xpfe/global/resources/content/bindings/tabbox.xml
index 8e576877400..6b3149bb465 100644
--- a/xpfe/global/resources/content/bindings/tabbox.xml
+++ b/xpfe/global/resources/content/bindings/tabbox.xml
@@ -386,6 +386,8 @@
+ null
+
@@ -411,7 +415,7 @@
diff --git a/xpfe/global/resources/content/bindings/tabbrowser.xml b/xpfe/global/resources/content/bindings/tabbrowser.xml
index d4dfe5d4816..9eac1c126ef 100644
--- a/xpfe/global/resources/content/bindings/tabbrowser.xml
+++ b/xpfe/global/resources/content/bindings/tabbrowser.xml
@@ -51,8 +51,7 @@
-
+
@@ -814,13 +813,13 @@
this.mTabContainer.removeChild(oldTab);
this.mPanelContainer.removeChild(oldBrowser);
- this.selectedTab = this.mTabContainer.childNodes[newIndex];
+ // When the current tab is removed select a new tab
+ // and fire select events on tabpanels and tabs
+ this.mTabContainer.selectedIndex = newIndex;
- if (newIndex == index) {
- // No select event is going to fire. We need to just call updateCurrentBrowser()
- // by hand.
- this.updateCurrentBrowser();
- }
+ // When removing a tab to the left of the current tab
+ // fix up the panel index without firing any events
+ this.mPanelContainer.selectedIndex = newIndex;
]]>