A synchronous state flip from a user `onDragEnd` callback — e.g. closing
a Kobalte / Radix-style Dialog whose contents are the draggable — used
to race motion's later DOM-touching work (momentum dispatch, MV-ref
cleanup) and could wedge surrounding libraries that observe the same
DOM. Symptom: drawer slides closed but the page stays non-interactive
because Kobalte's scroll-lock + layer-stack pointer block never release.
Move the callback to the very end of handlePanEnd, after `whileDrag`
flip, body-style restore, pointer-capture release, momentum / snap-back
dispatch, AND MV-ref cleanup. By the time the callback runs, the drag
session is fully torn down — any reactive cascade triggered from it is
unambiguous about ownership.
Observationally compatible for callbacks that don't flip global state;
users can keep their handlers as plain synchronous functions and drop
queueMicrotask workarounds.
Regression test asserts body.style.userSelect is restored by the time
the callback fires.
312 browser + 22 SSR tests passing.