Skip to content

fix(sortable): line indicator draws one slot early on downward drags - #266

Open
KevinVandy wants to merge 1 commit into
PuruVJ:cursor/cloud-agent-1779803543133-o25azfrom
KevinVandy:fix/sortable-line-indicator-downward-offset
Open

KevinVandy wants to merge 1 commit into
PuruVJ:cursor/cloud-agent-1779803543133-o25azfrom
KevinVandy:fix/sortable-line-indicator-downward-offset

Conversation

@KevinVandy

Copy link
Copy Markdown

In indicator: 'line' mode the drop-line is positioned at rects[to_index], but rects includes the dragged item's ghost while to_index is in insert-after-removal space. Past the origin slot the two differ by one, so dragging down shows the line one row above where the item lands. Dragging up is unaffected.

  • #project now measures against the non-dragged items only, via a small exported lineIndicatorRects helper. This matches what the foreign-list path already does.
  • Adds a unit test that checks the line index against reorderKeys for every from/to pair.
  • Changeset: @neodrag/core patch.

Repro: three rows a/b/c, drag a past b's midpoint. The line draws on b's top edge while the item commits after b.

Notes

Based on cursor/cloud-agent-1779803543133-o25az because it is the only pushed branch that contains the line-indicator code (the published 3.0.0-next.12 has it too). Happy to retarget.

🤖 Generated with Claude Code

In indicator: 'line' mode, #project drew the drop-line using every item's
rect (the dragged item's ghost included) at to_index, which is in
insert-after-removal space. Past the origin slot those spaces differ by
one, so a downward drag drew the line one row above where the item
committed. Upward drags were unaffected because the spaces coincide.

Skip the dragged item when building the rect list, matching how the
foreign-list path already measures. Adds a unit test that checks the
line index against reorderKeys for every from/to pair.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9b6ec18

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@neodrag/core Patch
@neodrag/liveblocks Patch
@neodrag/react Patch
@neodrag/solid Patch
@neodrag/svelte Patch
@neodrag/vanilla Patch
@neodrag/vue Patch
@neodrag/yjs Patch
@neodrag/playground-svelte Patch
docs Patch
scripts Patch
@neodrag/playground-react Patch
@neodrag/playground-solid Patch
@neodrag/playground-vanilla-umd Patch
@neodrag/playground-vanilla Patch
@neodrag/playground-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

@KevinVandy is attempting to deploy a commit to the Purus Projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

1 participant