Fix tab selection when closing a tab nearby

Fixes #3151
This commit is contained in:
Martynas Bagdonas 2023-06-06 19:42:34 +03:00
parent 785dcb30c3
commit bb85e11a92

View file

@ -273,6 +273,8 @@ var Zotero_Tabs = new function () {
}
this._tabs.splice(tabIndex, 1);
document.getElementById(tab.id).remove();
// For unknown reason fx102, unlike 60, sometimes doesn't automatically update selected index
this.deck.selectedIndex = Array.from(this.deck.children).findIndex(x => x.id == this._selectedID);
if (tab.onClose) {
tab.onClose();
}