mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 21:59:59 +02:00
Refactor ZenViewSplitter to fix tab closing bug
This commit is contained in:
parent
4101126d54
commit
7692662dd7
1 changed files with 3 additions and 2 deletions
|
@ -536,8 +536,9 @@ var gZenViewSplitter = new (class {
|
|||
if (this.currentView < 0) return;
|
||||
const currentTab = window.gBrowser.selectedTab;
|
||||
const tabs = this._data[this.currentView].tabs;
|
||||
for (const tab of tabs) {
|
||||
this.handleTabClose({ target: tab, forUnsplit: true });
|
||||
// note: This MUST be an index loop, as we are removing tabs from the array
|
||||
for (let i = tabs.length - 1; i >= 0; i--) {
|
||||
this.handleTabClose({ target: tabs[i], forUnsplit: true });
|
||||
}
|
||||
window.gBrowser.selectedTab = currentTab;
|
||||
this.updateSplitViewButton(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue