-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Description
When dragging a block using the grip handle, moving the cursor near the top or bottom edge of the editor viewport does not auto-scroll. The user has to drop the block, scroll manually, then drag again to move blocks over long distances.
Expected Behavior
The editor should auto-scroll when dragging a block near the top/bottom edges of the viewport, similar to how Notion handles block dragging.
Current Behavior
Dragging a block to the edge of the viewport stops — no scrolling occurs. The drop target line only appears within the currently visible portion of the editor.
Notes
This is a limitation of DraggableBlockPlugin_EXPERIMENTAL from @lexical/react. A fix would likely involve adding a dragover or mousemove listener during drag that calls scrollBy() on the scroll container when the cursor is within a threshold (e.g. 50px) of the top/bottom edge.
Files
src/components/editor/plugins/draggable-block-plugin.tsx