From e837158e4cc6860a49e4c7924fc92cddefcfe0c2 Mon Sep 17 00:00:00 2001 From: Andrey Bochkarev <50177704+octaviusz@users.noreply.github.com> Date: Sun, 12 Jul 2026 18:29:29 +0300 Subject: [PATCH] gh-14545: Correctly handle dnd moving a tab to an empty space (gh-14562) --- src/zen/drag-and-drop/ZenDragAndDrop.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index 8443eddfa..266ffbf35 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -1336,7 +1336,8 @@ // Essentials should be properly handled by ::animateVerticalPinnedGridDragOver if (!dropElement || dropElement.hasAttribute("zen-essential")) { this.clearDragOverVisuals(); - return null; + // If dropElement is null or essential, dropElement should be the empty tab + return [dropBefore, gZenWorkspaces._emptyTab]; } if (dropElement.hasAttribute("zen-empty-tab") && dropElement.group) { let secondTab = dropElement.group.tabs[1];