Skip to content

[Table] Support dragging content from a selected table cell range - #3422

Merged
juliaroldi merged 4 commits into
masterfrom
u/juliaroldi/drag-cells
Aug 3, 2026
Merged

[Table] Support dragging content from a selected table cell range#3422
juliaroldi merged 4 commits into
masterfrom
u/juliaroldi/drag-cells

Conversation

@juliaroldi

@juliaroldi juliaroldi commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for dragging content out of a selected table cell range. When the user presses down inside an existing table selection with a single click, the selection is converted into a native range selection so the highlighted content can be dragged and dropped elsewhere, gated behind the HandleDropInternalContent experimental feature.

Experimental Feature enabled:
DragCellsFlightOn

Experimental Feature disabled:
DragCellsFlightOff

Key changes:

  • SelectionPlugin: detect mouse-down inside an active table selection (isInsideTableSelection) and switch to a draggable native range (setTableDragSelection), clearing the grey table-cell highlight and restoring the caret. On drop (via ChangeSource.Drop) or mouse-up, the temporary selection is cleared.
  • DragAndDropPlugin: gate handleDroppedInternalContent behind the HandleDropInternalContent experimental feature and show a thin caret-like drag image when dragging from a table selection (adjustDraggingCursor).
  • Export DOM_SELECTION_CSS_KEY and HIDE_CURSOR_CSS_KEY as @internal so the selection plugin can reset those editor styles while dragging.

How to test

  1. Run the unit tests:
    • yarn test:fast --testPathPattern=SelectionPluginTest
    • yarn test:fast --testPathPattern=DragAndDropPluginTest
  2. Manual test (requires the HandleDropInternalContent experimental feature enabled):
    • Select a range of table cells so the grey table selection appears.
    • Press and hold inside the selection with a single click, then drag to another location and drop.
    • Before this change: the table selection is cleared immediately on mouse-down and the content cannot be dragged.
    • After this change: the highlighted content stays draggable, a thin caret drag image follows the cursor, and dropping moves the content; the temporary selection is cleared on drop/mouse-up.

@juliaroldi juliaroldi changed the title wip drag cells [Table] Support dragging content from a selected table cell range Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-03 18:16 UTC

@juliaroldi
juliaroldi marked this pull request as ready for review July 31, 2026 19:34
@juliaroldi
juliaroldi merged commit d1ad2e8 into master Aug 3, 2026
8 checks passed
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