Bug 1933279 - Remove tabs from multiselection once added to tab group. r=dwalker,tabbrowser-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D230222
This commit is contained in:
Dão Gottwald
2024-11-27 02:08:55 +00:00
parent f29f3efc8c
commit 6a25e2974a
2 changed files with 10 additions and 2 deletions

View File

@@ -5675,6 +5675,7 @@
}
this._handleTabMove(aTab, () => aGroup.appendChild(aTab));
this.removeFromMultiSelectedTabs(aTab);
}
/**
@@ -5688,8 +5689,8 @@
moveActionCallback();
// We want to clear _allTabs after moving nodes because the order of
// vertical tabs may have changed.
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
this._updateTabsAfterInsert();

View File

@@ -1176,7 +1176,14 @@ add_task(async function test_removeFromGroupForSingleTab() {
add_task(async function test_removeFromGroupForMultipleTabs() {
// initial tab strip: [group1, group1, group1, none, none, group2, group2, none, group3, none]
let tabs = createManyTabs(10);
[tabs[0], tabs[1], tabs[2]].forEach(t => {
gBrowser.addToMultiSelectedTabs(t);
ok(t.multiselected, "added tab to mutliselection");
});
gBrowser.addTabGroup([tabs[0], tabs[1], tabs[2]], { insertBefore: tabs[0] });
[tabs[0], tabs[1], tabs[2]].forEach(t => {
ok(!t.multiselected, "tab no longer multiselected after adding to group");
});
gBrowser.addTabGroup([tabs[5], tabs[6]], { insertBefore: tabs[5] });
gBrowser.addTabGroup([tabs[8]], { insertBefore: tabs[8] });