From 295874f80394de0bec19886011fe03702f8e987f Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Mon, 30 Aug 2021 14:12:22 +0300 Subject: [PATCH] Fix issue where non-existing tab is selected when closing multiple tabs --- chrome/content/zotero/tabs.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 26a239f6a4..f6a0160765 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -208,6 +208,9 @@ var Zotero_Tabs = new function () { if (tab.id == this._selectedID) { this.select(this._prevSelectedID || (this._tabs[tabIndex + 1] || this._tabs[tabIndex - 1]).id); } + if (tab.id == this._prevSelectedID) { + this._prevSelectedID = null; + } this._tabs.splice(tabIndex, 1); document.getElementById(tab.id).remove(); if (tab.onClose) {