Skip to content

Comments

[pull] main from motiondivision:main#200

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

[pull] main from motiondivision:main#200
pull[bot] merged 40 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 30 commits January 19, 2026 10:36
When using `defaultTransition: { type: "spring" }` with a timeline
that has multiple segments for the same element, the spring type was
being spread into the final transition even though springs had already
been converted to duration-based easing functions.

This caused JSAnimation to throw "Only two keyframes currently
supported with spring" when the merged keyframes array had more than
2 keyframes.

The fix excludes `type` from `defaultTransition` when building the
final transition, since the spring has already been baked into the
easing functions array.

Fixes #3404
…ssion

When a drag component unmounts while a pan session is active (e.g., the user
has started a pointerdown but hasn't released yet), the PanSession's event
listeners on window were not being cleaned up. This could cause touch
scrolling to become disabled after the component unmounted.

The fix adds a call to `this.controls.cancel()` in DragGesture.unmount()
to properly clean up any active pan session and its associated window
event listeners.

Also adds a test to verify the cleanup behavior and a pointerCancel
helper to the test setup.

Fixes #3472
Safari incorrectly scales stroke-dasharray and stroke-dashoffset values
when using px units during page zoom. This causes SVG path animations
using pathLength to shrink progressively as the zoom level decreases.

The fix removes the px unit conversion and uses unitless numeric values
instead, which Safari does not scale during zoom operations.

Fixes #3301
Add optional chaining (?.) and nullish coalescing (|| 0) when
accessing document.body.scrollLeft and document.body.scrollTop
to prevent TypeError when document.body is temporarily null
during heavy DOM manipulation or aggressive reflows.

Fixes #3348
Create a new useAnimatedValue hook that extends useSpring's functionality
to support any motion transition type (spring, tween, inertia, keyframes).

Changes:
- Add attachAnimation and animatedValue functions in motion-dom
- Add useAnimatedValue hook in framer-motion
- Export AnimatedValueOptions type for TypeScript users
- Add comprehensive tests for the new hook

This addresses the feature request for a generic hook that accepts
animation type in options and returns a MotionValue, providing automatic
subscription management and type safety for different animation types.

Fixes #3322
Reduce code duplication by making useSpring and springValue thin wrappers
around the new useAnimatedValue/attachAnimation implementations. This
simplifies maintenance and ensures consistent behavior across all
animated value hooks.

- springValue now calls animatedValue with type: "spring"
- attachSpring now calls attachAnimation with type: "spring"
- useSpring now calls useAnimatedValue with type: "spring"
- Removed ~105 lines of duplicated code
…tioning

Add anchorY prop to AnimatePresence to control vertical anchor point during
exit animations in popLayout mode. Similar to the existing anchorX prop for
horizontal positioning, anchorY allows choosing between "top" (default) and
"bottom" positioning.

When an element is originally positioned using `bottom: 0`, setting
`anchorY="bottom"` ensures it maintains its position relative to the bottom
of its container during exit animations, fixing the reported bug where
elements would shift downward.

Changes:
- Add anchorY prop to AnimatePresenceProps type
- Add bottom measurement in PopChild's getSnapshotBeforeUpdate
- Use anchorY to determine whether to use top or bottom CSS positioning
- Pass anchorY through PresenceChild to PopChild
- Add test for bottom positioning preservation

Fixes #3324
Previously, the drag gesture was blocked on any keyboard-accessible element
(button, input, select, textarea, a) regardless of whether the element itself
had the drag prop. This meant motion.button with drag prop couldn't be dragged.

The fix only blocks drag when clicking on a keyboard-accessible *child* element
of the draggable element. If the draggable element itself is keyboard-accessible,
dragging should work when clicking directly on it.

Fixes #3473
Test the measureScroll logic directly rather than trying to
instantiate DocumentProjectionNode, which requires complex setup.
Update expected output in SSR tests to match the new unitless
stroke-dasharray and stroke-dashoffset values from commit 13fbdd8,
which fixed the Safari zoom bug (#3301).
…vior

Changed from calling cancel() to endPanSession() during unmount. The full
cancel() method modifies projection animation state and releases drag locks,
which can interfere with nested drag scenarios.

The new endPanSession() method only cleans up the pan session event listeners
on window, which is all that's needed to fix the scrolling issue without
affecting nested drag behavior.

Fixes the "Nested drag -- Child layout" test regression.
Rename all related functions for consistency:
- useAnimatedValue → useFollowValue
- animatedValue → followValue
- attachAnimation → attachFollow
- AnimatedValueOptions → FollowValueOptions
Fix docs typo in use-presence.ts
…-accessible-dFvfp

Ensure `drag` always applies to keyboard-accessible elements
Two issues were preventing spring animations from working correctly
when using defaultTransition with timeline sequences:

1. The `type` property wasn't falling back to defaultTransition.type,
   so segments without explicit type would use "keyframes" instead of
   the spring type from defaultTransition.

2. Spring properties like stiffness and damping weren't being passed
   from defaultTransition to the spring generator, so the spring
   easing function couldn't be created correctly.
…3472-8gfhG

Fix drag gesture after context menu opens
mattgperry and others added 10 commits January 20, 2026 15:32
…ed-code-tUxB5

Fix multiple keyframes warning in timeline
The tests were using short 50ms waits after cy.visit() which wasn't
enough time on CI for React to mount, run useEffect, and set up layout
projection. Increased to 200ms to match other stable drag tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@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 9a673e4 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.

3 participants