Skip to content

Fix "Stacking order can only be calculated for elements with a common ancestor" error - #771

Merged
bvaughn merged 1 commit into
mainfrom
bvaughn/bug-fix-769
Oct 20, 2026
Merged

bvaughn merged 1 commit into
mainfrom
bvaughn/bug-fix-769

Conversation

@bvaughn

@bvaughn bvaughn commented Oct 20, 2026

Copy link
Copy Markdown
Owner

The document pointermove handler calls isViableHitTarget, which compares the stacking order of event.target and the panel group. If the target is removed from the DOM while the event is being dispatched, the two elements no longer share an ancestor, and the vendored compare() throws:

Stacking order can only be calculated for elements with a common ancestor

The fix is for isViableHitTarget to return true early if either the pointer target or the group element is no longer connected (!isConnected). An element that's been removed isn't rendered, so it can't be covering the separator.

Resolves #769

@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-resizable-panels Ready Ready Preview Oct 20, 2026 9:18pm UTC

@bvaughn
bvaughn merged commit 64c5be9 into main Oct 20, 2026
7 checks passed

This branch was successfully deployed

1 active deployment
Preview — 3e312830 Deployed Oct 20, 2026 by vercel[bot]
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.

"Stacking order can only be calculated for elements with a common ancestor" thrown from document pointermove when the event target has been removed

1 participant