Fixed dragging split views tabs outisde of the container

This commit is contained in:
mr. m
2025-03-07 13:37:28 +01:00
parent 9466f6ee86
commit 0575373167

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index fa96568d366fd3608f9bd583fa793150bd815c8b..693549cec63365c5f338410429f922fa5b7f3f81 100644
index fa96568d366fd3608f9bd583fa793150bd815c8b..9151fa411faa9689c7b079fafe0fab1234177f40 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -94,7 +94,7 @@
@@ -385,26 +385,20 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..693549cec63365c5f338410429f922fa
);
if (this.#rtlMode) {
@@ -2347,8 +2383,16 @@
(lastMovingTabScreen + tabSize);
@@ -2348,7 +2384,11 @@
translate = Math.min(Math.max(translate, firstBound), lastBound);
- for (let tab of movingTabs) {
for (let tab of movingTabs) {
- tab.style.transform = `${translateAxis}(${translate}px)`;
+ if (draggedTab.group?.hasAttribute("split-view-group")) {
+ draggedTab.group.style.transform = `${translateAxis}(${translate}px)`;
+ } else {
+ for (let tab of movingTabs) {
+ if (tab.group?.hasAttribute("split-view-group")) {
+ tab.group.style.transform = `${translateAxis}(${translate}px)`;
+ } else {
+ tab.style.transform = `${translateAxis}(${translate}px)`;
+ }
+ if (tab.group?.hasAttribute("split-view-group")) {
+ tab.group.style.transform = `${translateAxis}(${translate}px)`;
+ } else {
+ tab.style.transform = `${translateAxis}(${translate}px)`;
+ }
}
dragData.translatePos = translate;
@@ -2484,12 +2528,16 @@
@@ -2484,12 +2524,16 @@
// Shift background tabs to leave a gap where the dragged tab
// would currently be dropped.
for (let tab of tabs) {
@@ -422,7 +416,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..693549cec63365c5f338410429f922fa
if (tab.group?.tabs[0] == tab) {
tab.group.style.setProperty(
"--tabgroup-dragover-transform",
@@ -2541,8 +2589,9 @@
@@ -2541,8 +2585,9 @@
);
}
@@ -434,7 +428,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..693549cec63365c5f338410429f922fa
return;
}
@@ -2553,6 +2602,7 @@
@@ -2553,6 +2598,7 @@
tab.style.transform = "";
if (tab.group) {
tab.group.style.removeProperty("--tabgroup-dragover-transform");
@@ -442,7 +436,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..693549cec63365c5f338410429f922fa
}
tab.removeAttribute("dragover-createGroup");
}
@@ -2604,7 +2654,7 @@
@@ -2604,7 +2650,7 @@
movingTab._moveTogetherSelectedTabsData.newIndex = movingTabNewIndex;
movingTab._moveTogetherSelectedTabsData.animate = false;
};
@@ -451,7 +445,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..693549cec63365c5f338410429f922fa
postTransitionCleanup();
} else {
let onTransitionEnd = transitionendEvent => {
@@ -2707,9 +2757,9 @@
@@ -2707,9 +2753,9 @@
function newIndex(aTab, index) {
// Don't allow mixing pinned and unpinned tabs.
if (aTab.pinned) {
@@ -463,7 +457,7 @@ index fa96568d366fd3608f9bd583fa793150bd815c8b..693549cec63365c5f338410429f922fa
}
}
@@ -2793,7 +2843,7 @@
@@ -2793,7 +2839,7 @@
}
_notifyBackgroundTab(aTab) {