Skip to content

Dropcursor position not indicative of where item will be placed in lists #7638

@JochemvanHout

Description

@JochemvanHout

Affected Packages

"@tiptap/core": "^3.20.0",     "@tiptap/extension-drag-handle": "^3.20.0",     "@tiptap/extension-drag-handle-vue-3": "^3.20.0",     "@tiptap/extension-placeholder": "^3.20.0",     "@tiptap/extension-unique-id": "^3.20.0",     "@tiptap/pm": "^3.20.0",     "@tiptap/starter-kit": "^3.20.0",     "@tiptap/suggestion": "^3.20.0",     "@tiptap/vue-3": "^3.20.0",

Version(s)

3.20.0

Bug Description

  • While holding a node via the drag handle, moving the mouse vertically through list items can skip positions (e.g., jumps from between items 2-3 straight to 4-5)
  • Moving horizontally between list items with different text lengths causes the dropcursor to flip between positions
  • The dropcursor indicator doesn't always match where the user visually expects the drop to land

Browser Used

Edge

Code Example URL

https://template.tiptap.dev/preview/templates/notion-like/CrMj9M9KnP

Expected Behavior

The dropcursor accurately shows where the mouse pointer is located

Additional Context (Optional)

Reproduction:

  1. Create a list with items of varying text length (e.g., long items followed by short items)
  2. Drag a block and move the mouse slowly down through the list
  3. Observe the dropcursor skipping positions or jumping
  4. Move the mouse horizontally between items — the dropcursor flips between positions

Perhaps it has something to do with the length of the item because I noticed the behaviour was different when all items were longer.

See attached video. This bug was reproduced in the official notion like editor template as well as our local environment.

tiptap.lists.bug.1.mp4

This is what Claude thought the root cause was, which might be helpful (or not)

Root cause:
posAtCoords resolves to the nearest text character position, not the nearest block boundary. List items with longer text have wider hit zones than shorter ones. When moving vertically, the cursor can skip over a gap between items if the hit zones don't cover it evenly. Horizontal position matters because it determines which item's text zone you're closest to.

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions