Skip to content

[6.x] Prevent bogus content when dragging inside a node-selected Bard set - #15049

Merged
jasonvarga merged 1 commit into
6.xfrom
prevent-set-selection-drag
Jul 22, 2026
Merged

[6.x] Prevent bogus content when dragging inside a node-selected Bard set#15049
jasonvarga merged 1 commit into
6.xfrom
prevent-set-selection-drag

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Jul 22, 2026

Copy link
Copy Markdown
Member

This pull request fixes an issue where dragging a Grid row inside a Bard set could dump a copy of the set's content into the editor as a table.

This was happening because clicking a non-interactive area inside a set makes ProseMirror node-select it (the blue border). That node selection is backed by a real DOM selection spanning the whole set, which ProseMirror hides visually — so when you drag from anywhere inside the set (like a Grid row's drag handle), the browser starts a native drag of that invisible selection instead of the row sort. And since ProseMirror ignores dragstart events originating inside node views, the drag data ends up being the set's raw HTML, meaning Bard parses the Grid's <table> markup into an actual table node on drop.

This PR fixes it by preventing native dragstart events that originate inside the set while the document selection covers the whole set. Drags of genuinely draggable elements (like Bard images, or nested sets via their drag handles) are unaffected, as is dragging the set itself using its own drag handle.

Fixes #14920

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit 4e215a4 into 6.x Jul 22, 2026
24 checks passed
@jasonvarga
jasonvarga deleted the prevent-set-selection-drag branch July 22, 2026 20:26
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.

Drag and drop with Grid field creates bogus content

2 participants