Merge master into v8-branch (reconcile popout sash/scrollbar fix + add PR #1478 regression test)#1480
Merged
Merged
Conversation
…s document Splitview registers a sash's pointerdown on the sash element, but registers the follow-up pointermove/pointerup/pointercancel/contextmenu listeners on the global document. An element inside a popout window dispatches its pointer events into that window's document, so those listeners never fire: the drag arms on pointerdown and then nothing moves, and the sash cannot be dragged. Scrollbar repeats the pattern, so the tab-bar overflow scrollbar is affected too. Floating groups render into the main document, which is why the global document happens to be correct for them and only popout groups break. Resolve the owning document from the element instead. It is captured once per drag into a const closed over by both the add and the matching remove, so a listener can never be added on one document and removed from another.
Drives a sash drag on a Splitview built inside a second document (document.implementation.createHTMLDocument), which is the shape a popout window has: the element lives in that window's document, so its pointer events are dispatched there. Fails before the ownerDocument fix — the pointermove never reaches the listener bound to the global document, so the views never resize. The existing sash-drag test dispatches on the global document, where sash.ownerDocument === document, so it passes either way and cannot catch this.
fix(core): sash and scrollbar cannot be dragged inside a popout window
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Merges
master(which now includes #1478) intov8-branch.The popout sash/scrollbar drag bug that #1478 fixes was already fixed independently on
v8-branch— the drag listeners are bound to the element's owning document (sash.ownerDocument ?? document/this._scrollbar.ownerDocument ?? document) rather than the globaldocument. Because both branches edited the same listener-registration lines but inserted theirconst doc = …declaration at different line positions, git auto-merged with no conflict yet produced a duplicateconst docdeclaration in the same scope in bothsplitview.tsandscrollbar.ts(Cannot redeclare block-scoped variable 'doc') — a clean-looking merge that would not compile.This PR resolves that: the redundant #1478-side declarations were removed, keeping v8-branch's existing
?? documentvariant. Net effect on the source files versusv8-branchis zero — they are byte-identical to before. The only new content carried over from master is #1478's regression test.packages/dockview-core/src/splitview/splitview.ts— dropped the duplicateconst doc = sash.ownerDocument;; keptconst doc = sash.ownerDocument ?? document;.packages/dockview-core/src/scrollbar.ts— dropped the duplicateconst doc = this.element.ownerDocument;; keptconst doc = this._scrollbar.ownerDocument ?? document;.packages/dockview-core/src/__tests__/splitview/splitview.spec.ts— gains fix(core): sash and scrollbar cannot be dragged inside a popout window #1478'sdnd: sash drag follows pointer events in the element's own documenttest, which builds aSplitviewinside a second document (document.implementation.createHTMLDocument()) — the shape a popout window has — and drives a real sash drag. v8-branch previously lacked coverage for this regression.Type of change
Affected packages
dockview-coreHow to test
yarn test—splitview.specpasses (26/26), including the new second-document regression test. Confirmed the two source files are byte-identical tov8-branch(git diffempty), so no behavioural change beyond added test coverage.Checklist
yarn testpassesGenerated by Claude Code