Bug 1937203 - Tab group panel should close when expanding/collapsing a group. r=jswinarton,tabbrowser-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D232657
This commit is contained in:
Dão Gottwald
2024-12-19 20:30:41 +00:00
parent e991ba1e5f
commit 3336bd457a
2 changed files with 13 additions and 8 deletions

View File

@@ -97,7 +97,7 @@
});
this.#createButton.addEventListener("click", () => {
this.#panel.hidePopup();
this.close();
});
this.#nameField.addEventListener("input", () => {
@@ -172,10 +172,6 @@
this.#swatches = [];
}
get activeGroup() {
return this.#activeGroup;
}
get createMode() {
return this.#createMode;
}
@@ -185,6 +181,10 @@
this.#createMode = mode;
}
get activeGroup() {
return this.#activeGroup;
}
set activeGroup(group = null) {
this.#activeGroup = group;
this.#nameField.value = group ? group.label : "";
@@ -246,6 +246,10 @@
gBrowser.openTabs.length == this.activeGroup?.tabs.length;
}
close() {
this.#panel.hidePopup();
}
on_popupshown() {
this.#nameField.focus();
}
@@ -256,7 +260,7 @@
on_keypress(event) {
if (event.keyCode == KeyEvent.DOM_VK_RETURN) {
this.#panel.hidePopup();
this.close();
}
}
@@ -274,14 +278,14 @@
#handleCancel() {
this.activeGroup.ungroupTabs();
this.#panel.hidePopup();
this.close();
}
async #handleNewTabInGroup() {
let lastTab = this.activeGroup?.tabs.at(-1);
let onTabOpened = async aEvent => {
this.activeGroup?.addTabs([aEvent.target]);
this.#panel.hidePopup();
this.close();
window.removeEventListener("TabOpen", onTabOpened);
};
window.addEventListener("TabOpen", onTabOpened);

View File

@@ -227,6 +227,7 @@
if (event.target === this.#labelElement && event.button === 0) {
event.preventDefault();
this.collapsed = !this.collapsed;
gBrowser.tabGroupMenu.close();
}
}