Fix issue where non-existing tab is selected when closing multiple tabs

This commit is contained in:
Martynas Bagdonas 2021-08-30 14:12:22 +03:00
parent b8cb093f79
commit 295874f803

View file

@ -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) {