fix(view): stop portal pointer events from bubbling to view tab dnd#3233
Open
FQFangQi wants to merge 1 commit into
Open
fix(view): stop portal pointer events from bubbling to view tab dnd#3233FQFangQi wants to merge 1 commit into
FQFangQi wants to merge 1 commit into
Conversation
Radix ContextMenu and Dialog content render in a portal but React synthetic events still bubble to ancestors. That activated dnd-kit listeners on the draggable view tab strip when dragging inside menus or share dialogs. Stop pointer/mouse down propagation on overlay and content, and disable tab drag listeners while the view context menu is open. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
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.


Summary
Fixes a bug where dragging inside a view tab context menu or share dialog incorrectly triggered dnd-kit reordering on the view tab strip.
Radix
ContextMenuandDialogrender content in a portal, but React synthetic events still bubble through the component tree to ancestors. View tabs attach dnd-kitlistenerson a wrapper aroundViewListItem, so pointer events from portaled overlays activated tab drag.Changes
pointerdown/mousedownpropagation onContextMenuContent,ContextMenuSubContent,DialogOverlay, andDialogContentViewList/ViewListItem)Test plan