Bug 1947758 - improve group handling in gBrowser.moveTabForward/Backward. r=dao,tabbrowser-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D238124
This commit is contained in:
DJ
2025-02-14 11:24:14 +00:00
parent 446c806f4e
commit f43ce0afa5
2 changed files with 61 additions and 92 deletions

View File

@@ -5865,7 +5865,7 @@
nextTab.group.after(selectedTab);
} else {
// Enter first position of tab group.
nextTab.group.prepend(selectedTab);
nextTab.group.insertBefore(selectedTab, nextTab);
}
} else if (selectedTab.group != nextTab.group) {
// Standalone tab after tab group.
@@ -5874,6 +5874,10 @@
nextTab.after(selectedTab);
}
});
} else if (selectedTab.group) {
// selectedTab is the last tab and is grouped.
// remove it from its group.
selectedTab.group.after(selectedTab);
}
}
@@ -5902,6 +5906,10 @@
previousTab.before(selectedTab);
}
});
} else if (selectedTab.group) {
// selectedTab is the first tab and is grouped.
// remove it from its group.
selectedTab.group.before(selectedTab);
}
}