Skip to content

Comments

[pull] main from motiondivision:main#190

Merged
pull[bot] merged 23 commits intocode:mainfrom
motiondivision:main
Jan 7, 2026
Merged

[pull] main from motiondivision:main#190
pull[bot] merged 23 commits intocode:mainfrom
motiondivision:main

Conversation

@pull
Copy link

@pull pull bot commented Jan 7, 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 : )

mattgperry and others added 23 commits January 5, 2026 18:08
Prevents drag from starting when clicking on input, textarea, select,
button, anchor, or contenteditable elements inside a draggable component.
This allows normal interaction with form elements (focus, text selection)
without triggering the parent's drag gesture.

Fixes #1674

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidates interactive element detection logic between drag and press
gestures. Adds isContentEditable check to the shared utility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests verify that drag gestures do not trigger when interacting with:
- Button
- Link (anchor)
- Select dropdown
- Checkbox inside label
- ContentEditable element

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a draggable element with ref-based constraints is dragged outside
its boundaries (with dragElastic), it should animate back within the
constraints when released. However, if the user clicks on the element
while it's animating back, the animation was being stopped and the
element would get "stuck" outside the constraints.

The fix:
1. Always pause (not stop) animations when pointerdown occurs, so the
   animation can be resumed if no drag starts
2. Resume the paused animation when the user releases without dragging
   (just clicking), ensuring the constraint animation continues

Fixes #2697

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When snapToCursor is used, we need to STOP the animation (not pause)
because snapToCursor sets new position values. A paused animation's
state would interfere with the new values being set.

The pause behavior is still needed for the constraint animation fix
when snapToCursor is not used.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When using Radix UI's asChild prop with motion components inside
AnimatePresence, exit animations were not running. This was because
externalRef was in the useMotionRef useCallback dependency array,
causing the callback to be recreated whenever Radix created a new
composed ref on render.

The fix stores externalRef in a ref to access the current value
without including it in the dependency array. This preserves:
- React 19 cleanup function support
- Proper ref forwarding
- AnimatePresence exit animations with libraries like Radix UI

Added E2E test with @radix-ui/react-dialog to verify the fix.

Fixes #3455

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When dragging an element during a constraint animation (interrupting the
animation with a new drag), the element would jump to the wrong position
on release. The jump size was proportional to the second drag gesture size.

Root cause: When a drag started during a paused animation, the motion value's
get() returned stale data from the paused animation state instead of the
current rendered position. This caused originPoint to be set incorrectly.

Fix: Call stopAnimation() in onStart (when actual drag begins) to properly
sync the motion value to its current position before recording originPoint.

The animation lifecycle is now:
1. onSessionStart: pauseAnimation() - allows resume if no drag starts (click)
2. onStart (if drag begins): stopAnimation() - sync value for accurate originPoint
3. During drag: values set directly via set()
4. onEnd: startAnimation() - new constraint animation from correct position

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix AnimatePresence exit animations with Radix UI asChild
…ence-ref

Revert "Fix AnimatePresence exit animations with Radix UI asChild"
…with onTap

The previous tabIndex !== -1 check was too broad - it blocked drag for any
element with tabIndex, including motion.div elements that automatically get
tabIndex=0 when onTap is set. Now only blocks drag for actual interactive
form elements (INPUT, TEXTAREA, SELECT, BUTTON, A) and contentEditable.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix drag constraints getting stuck when clicked during animation
When using Radix UI's asChild prop with motion components inside
AnimatePresence, exit animations were not running. This was because
externalRef was in the useMotionRef useCallback dependency array,
causing the callback to be recreated whenever Radix created a new
composed ref on render.

The fix stores externalRef in a ref (updated via useInsertionEffect
for concurrent mode safety) to access the current value without
including it in the dependency array. This preserves:
- React 19 cleanup function support
- Proper ref forwarding
- AnimatePresence exit animations with libraries like Radix UI

Added E2E tests with @radix-ui/react-dialog to verify the fix.

Fixes #3455

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix drag gesture triggering on interactive elements inside draggables
…ix-v2

Fix AnimatePresence exit animations with Radix UI asChild
@pull pull bot locked and limited conversation to collaborators Jan 7, 2026
@pull pull bot added the ⤵️ pull label Jan 7, 2026
@pull pull bot merged commit 10e3c81 into code:main Jan 7, 2026
1 check failed
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.

1 participant