Bug 1934296 - Adding a tab to a collapsed group should expand the group. r=tabbrowser-reviewers,jswinarton
Differential Revision: https://phabricator.services.mozilla.com/D230982
This commit is contained in:
@@ -5660,8 +5660,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
aGroup.collapsed = false;
|
||||
this._handleTabMove(aTab, () => aGroup.appendChild(aTab));
|
||||
this.removeFromMultiSelectedTabs(aTab);
|
||||
this.tabContainer._notifyBackgroundTab(aTab);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -329,6 +329,9 @@
|
||||
if (tab.hasAttribute("fadein")) {
|
||||
if (tab._fullyOpen) {
|
||||
this._updateCloseButtons();
|
||||
if (tab.group && tab == tab.group.lastChild) {
|
||||
this._notifyBackgroundTab(tab);
|
||||
}
|
||||
} else {
|
||||
this._handleNewTab(tab);
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ add_task(async function test_tabGroupUniqueColors() {
|
||||
|
||||
add_task(async function test_tabGroupCollapseAndExpand() {
|
||||
let tab1 = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
let tab2 = BrowserTestUtils.addTab(gBrowser, "about:blank");
|
||||
let group = gBrowser.addTabGroup([tab1]);
|
||||
|
||||
Assert.ok(!group.collapsed, "group is expanded by default");
|
||||
@@ -116,6 +117,11 @@ add_task(async function test_tabGroupCollapseAndExpand() {
|
||||
gBrowser.selectedTab = group.tabs[0];
|
||||
Assert.ok(!group.collapsed, "group is expanded after selecting tab");
|
||||
|
||||
group.collapsed = true;
|
||||
Assert.ok(group.collapsed, "group is collapsed via API");
|
||||
gBrowser.moveTabToGroup(tab2, group);
|
||||
Assert.ok(!group.collapsed, "group is expanded after moving tab into group");
|
||||
|
||||
await removeTabGroup(group);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user