gh-15134: Fixes tab removed from group getting focused (gh-15135)

Closes https://github.com/zen-browser/desktop/issues/15134

Fix video:

https://github.com/user-attachments/assets/1c06ea7f-d482-4d4a-8bbe-df41daa27616
This commit is contained in:
Nikola Hristov
2026-08-27 23:40:43 +03:00
committed by GitHub
parent 3d53b37e8b
commit 9e0c790602

View File

@@ -230,7 +230,10 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature {
}
this.removeGroup(groupIndex);
if (changeTab) {
gBrowser.selectedTab = remainingTabs[0];
const tabToSelect = remainingTabs.find(remaining => remaining !== tab);
if (tabToSelect) {
gBrowser.selectedTab = tabToSelect;
}
document
.getElementById("cmd_zenNewEmptySplit")
.removeAttribute("disabled");