Skip to content

fix(pane): prevent drop zones from blocking clicks after workspace switch#18

Merged
amirlehmam merged 1 commit into
amirlehmam:masterfrom
schroldgames:fix/drag-active-stuck-on-workspace-switch
Jun 3, 2026
Merged

fix(pane): prevent drop zones from blocking clicks after workspace switch#18
amirlehmam merged 1 commit into
amirlehmam:masterfrom
schroldgames:fix/drag-active-stuck-on-workspace-switch

Conversation

@schroldgames

@schroldgames schroldgames commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Removes e.stopPropagation() from handleEdgeDrop and handleCenterDrop in PaneWrapper.tsx
  • Adds a safety-net useEffect that clears dragActive whenever a workspace becomes active

Root cause

In React 17+, synthetic event handlers fire at the React root container (not document). Calling stopPropagation() inside handleEdgeDrop / handleCenterDrop prevented the native drop event from bubbling past the React root to document. Every other PaneWrapper listens at the document level for drop to reset dragActive = false — they never received the event and stayed permanently stuck with dragActive = true.

After any tab drag-to-split, all panes in all workspaces had dragActive = true. Switching to another workspace then rendered the drop zone overlay (the "highlighted sections") over every terminal with pointer-events: auto, blocking all mouse interaction.

Fix

  1. Remove stopPropagation() from both drop handlers so the native drop event propagates to document and all PaneWrapper instances reset correctly.
  2. Safety-net useEffect — clears dragActive when isWorkspaceActive transitions to true, covering the edge case where dragend fires on a detached DOM element (e.g. when splitAndMoveSurface removes the source tab from the tree before dragend fires) and never reaches document.

Test plan

  • Drag a terminal tab to an edge drop zone to split the pane
  • Switch to another workspace — no highlighted overlay sections should appear, terminal clicks should work normally
  • Drag a terminal tab to the center drop zone to merge panes, then switch workspace — same result
  • Verify normal tab reordering (drag within the tab bar) still works

🤖 Generated with Claude Code

…itch

In React 17+, events are handled at the React root container rather than
document. Calling stopPropagation() in handleEdgeDrop/handleCenterDrop
prevented the native drop event from reaching document-level listeners,
so every other PaneWrapper's dragActive reset handler never fired.

The result: after any tab drag-to-split, all panes across all workspaces
stayed stuck with dragActive=true. Switching to another workspace then
showed the drop zone overlay (highlighted sections) over every terminal
with pointer-events:auto, blocking all mouse interaction.

Fix: remove stopPropagation() from the two drop handlers so the drop
event propagates to document and all panes reset correctly. Also add a
safety-net useEffect that clears dragActive whenever a workspace becomes
active, covering the edge case where dragend fires on a detached element.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@schroldgames schroldgames force-pushed the fix/drag-active-stuck-on-workspace-switch branch from f907376 to 36ffc76 Compare June 1, 2026 23:46
@amirlehmam amirlehmam merged commit 2dcd0bd into amirlehmam:master Jun 3, 2026
@schroldgames schroldgames deleted the fix/drag-active-stuck-on-workspace-switch branch June 5, 2026 04:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants