Skip to content

Comments

[pull] main from motiondivision:main#199

Merged
pull[bot] merged 14 commits intocode:mainfrom
motiondivision:main
Jan 20, 2026
Merged

[pull] main from motiondivision:main#199
pull[bot] merged 14 commits intocode:mainfrom
motiondivision:main

Conversation

@pull
Copy link

@pull pull bot commented Jan 20, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

claude and others added 14 commits January 19, 2026 10:04
Enable sourcemap generation in the CJS and ES output configurations for
motion-dom and motion-utils by adding the sourcemaps plugin and output
option. This fixes the "Can't resolve original location of error"
warnings when building with tools like Vite that rely on sourcemaps.

Fixes #3431
When the Reorder component is used on a scrollable page (without an
explicit overflow: auto/scroll container), the autoscroll feature
was not working because findScrollableAncestor only looked for
elements with overflow: auto/scroll CSS properties.

This fix adds support for page-level scrolling by:
1. Detecting when the document itself is scrollable (scrollHeight >
   innerHeight)
2. Using window.scrollBy() for page-level scrolling when no scrollable
   ancestor is found
3. Calculating scroll thresholds based on viewport dimensions instead
   of element bounds

Fixes #3469
The core fix: clamp the scrollable container's bounds to the viewport
when calculating distance from edges. Previously, if a container's
bottom was at y=800 but the viewport ended at y=600, dragging to
y=580 wouldn't trigger autoscroll because distanceFromEnd was 220px
(well above the 50px threshold).

Now we use:
- start = max(0, rect.top)
- end = min(viewportSize, rect.bottom)

This ensures autoscroll triggers when near the *visible* edge of the
container, regardless of whether the page is scrollable.

Also added support for page-level scrolling (using window.scrollBy)
when there's no scrollable container but the page itself is scrollable.

Fixes #3469
The gesture system uses pageX/pageY coordinates (from extractEventInfo
in event-info.ts), but getBoundingClientRect() returns viewport-relative
coordinates. When the page is scrolled, these coordinate systems don't
match, causing autoscroll to fail.

For example, if the page is scrolled 500px:
- pointerPosition (pageY) = 800
- rect.top (viewport) = 200
- distanceFromStart = 600 (way above 50px threshold)

The fix converts the pointer position to viewport coordinates by
subtracting the page scroll offset before comparing with rect bounds.

Fixes #3469
Previously, passing null elements to animateSequence (e.g., from
querySelector returning null) would throw an error. This was a
regression from Motion 10's permissive behavior.

Changes:
- Update resolveElements in motion-dom to return empty array for
  null/undefined input and filter null elements from arrays
- Update resolveSubjects in framer-motion to handle null/undefined
  subjects gracefully
- Add early return for null/undefined in animateSubject and
  animateElements to gracefully skip (distinct from throwing for
  selectors that match no elements)
- Add tests for null element handling in sequences

Fixes #3390
…croll-VMQKK

Fix reorder autoscroll on scrollable pages
@pull pull bot locked and limited conversation to collaborators Jan 20, 2026
@pull pull bot added the ⤵️ pull label Jan 20, 2026
@pull pull bot merged commit a93d4ff into code:main Jan 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants