Skip to content

fix(dom): reopen move feedback after optimistic sorting - #2206

Open
itisrmk wants to merge 1 commit into
clauderic:mainfrom
itisrmk:fix/move-feedback-popover-after-sort
Open

itisrmk wants to merge 1 commit into
clauderic:mainfrom
itisrmk:fix/move-feedback-popover-after-sort

Conversation

@itisrmk

@itisrmk itisrmk commented Nov 28, 2026

Copy link
Copy Markdown

Fixes #2203

With Feedback.configure({ feedback: 'move' }) the dragged element is itself the shown popover. When OptimisticSortingPlugin moves it with insertAdjacentElement, the removal closes the popover without a toggle event. It keeps popover="manual" but loses :popover-open, so the UA rule hides it with display: none for the rest of the drag.

The default feedback already watches for this with a mutation observer: when the element is re-inserted, it re-shows the popover and puts the placeholder back. This change reuses that observer for feedback: 'move' (with no placeholder), so the popover is reopened after an optimistic sort.

Tests: there is a new regression test in feedback-observers.test.ts (mocked popover) that fails on main and passes with the fix. In a real Chromium run with feedback: 'move', the dragged item went from display: none after the first sort to staying display: block. The default feedback is unchanged. The DOM tests and the build pass, and a patch changeset is added for @dnd-kit/dom.

#2111 shows the same symptom with Svelte, but I didn't confirm it has this cause, so it is out of scope here.

AI disclosure: I used an AI coding assistant (Devin) to write this change and its tests, and reviewed them.

@changeset-bot

changeset-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7584056

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

This PR includes changesets to release 10 packages
Name Type
@dnd-kit/dom Patch
@dnd-kit/abstract Patch
@dnd-kit/collision Patch
@dnd-kit/geometry Patch
@dnd-kit/helpers Patch
@dnd-kit/react Patch
@dnd-kit/solid Patch
@dnd-kit/state Patch
@dnd-kit/svelte Patch
@dnd-kit/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

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.

Sortable with feedback: 'move' disappears mid-drag: the popover is dismissed by the optimistic sort and never re-shown

1 participant