plans/issues/issue-2457.md
Executor instructions: This is a NEEDS-REPRO plan: both CodeSandboxes are Cloudflare-blocked, so the reporter's coordinate math cannot be inspected, and per repo policy (no repro → no fix) no code change is allowed here. Post the diagnostic comment; close only behind the gate. Update this issue's row in
plans/issues/README.md.Drift check (run first):
gh api repos/motiondivision/motion/issues/2457 --jq .state→open.
42bfbe3ed, 2026-06-11Reporter (Dec 2023, framer-motion v10-era): slider handles driven by onPan
work until the page is scrolled; afterwards the handle "jumps away from the
cursor" by what looks like the scroll offset. A follow-up comment says
switching to onDrag shows a similar offset. Repro sandboxes
(82zwjq, xm4nv3) are blocked, so we cannot see how the reported handles
are positioned — but the symptom is the classic page-vs-client coordinate
mixup, and the genuine library-side bugs in this family have since been
fixed.
42bfbe3ed)PanInfo.point is page-space, not client-space:
packages/framer-motion/src/events/event-info.ts:8-15 —
point: { x: event.pageX, y: event.pageY }. Positioning an element from
info.point while measuring its container with getBoundingClientRect()
(client/viewport-space) produces exactly a "jumps by scroll offset" bug in
user code. This is the most likely explanation for the onPan symptom.5d53f132f (2026-01-06) — element detaching from cursor when the page or
a container scrolls during drag (#1691).cfccb0300 (2026-05-12) — stale root scroll when measuring ref
constraints (#2829).9f228395e (2026-02-04) — velocity/momentum carry-over fixes.dragConstraints measured before
a nested container scroll are stale at drag start — that is exactly
issue #2024's diagnosis (see plans/issues/issue-2024.md). If the
commenter's onDrag variant used dragConstraints, it may be a duplicate
of #2024 rather than its own bug.gh api repos/motiondivision/motion/issues/2457/comments -f body='<comment>'
Comment content (adapt tone, keep facts):
info.point in onPan/onDrag is page-relative (pageX/pageY,
includes scroll). If you position the handle using info.point together
with viewport-relative measurements (getBoundingClientRect()), the result
will be offset by exactly the scroll distance — to mix them, subtract
window.scrollX/scrollY, or use info.offset / info.delta, which are
scroll-independent.motion v12.Gate: row for issue-2457 in plans/issues/README.md is APPROVED.
If approved:
gh api -X PATCH repos/motiondivision/motion/issues/2457 -f state=closed -f state_reason=not_planned
If not approved: leave open, mark row BLOCKED (awaiting close approval).
gh api .../issues/2457/comments --jq '.[-1].body' mentions pageX)plans/issues/README.md row updated; if issue-2024's plan was executed
first, the comment cross-references that fix/PRonPan with info.offset still jumps):
this becomes a real bug — stop and report so a FIX plan can be written
(likely joining the issue-2024 root cause).