From a1a2268f9bf6dbdc47c5f18c43a9ccc5a1b0a694 Mon Sep 17 00:00:00 2001 From: Andrey Bochkarev <50177704+octaviusz@users.noreply.github.com> Date: Sun, 12 Jul 2026 13:57:45 +0300 Subject: [PATCH] gh-14511: Prevent switching spaces when dragging outside (gh-14515) fixed: https://github.com/zen-browser/desktop/issues/14511 --- src/zen/drag-and-drop/ZenDragAndDrop.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index 67cf9a238..8443eddfa 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -69,6 +69,7 @@ #changeSpaceTimer = null; #isAnimatingTabMove = false; #firstHapticFeedbackPlayed = false; + #lastDragOverTime = 0; #dragOverSplit = {}; @@ -723,9 +724,11 @@ const { isNearLeftEdge, isNearRightEdge } = this.#shouldSwitchSpace(event); if (isNearLeftEdge || isNearRightEdge) { - if (!this.#changeSpaceTimer && !this.#isOutOfWindow) { + this.#lastDragOverTime = Date.now(); + if (!this.#changeSpaceTimer) { this.#changeSpaceTimer = setTimeout(() => { - if (this.#isOutOfWindow) { + const timeSinceLastDragOver = Date.now() - this.#lastDragOverTime; + if (timeSinceLastDragOver > 250) { return; } this.clearDragOverVisuals();