[FEATURE] Expand dragSnapToOrigin to allow for differentiating per-axis snap behavior
Is your feature request related to a problem? Please describe.
i have a use case where i have a motion component (the track of a carousel) that is draggable on both the x and y axis (i.e. drag={true}), and the x drag value should reset on drag end (either the carousel is transitioned to the next slide via animate or it returns to its original position of the user “undid” the drag gesture), but the y drag value shouldn’t reset (it’s used to dismiss the carousel, which is a fullscreen thing, by pulling down in, so if the user completes the gesture, the carousel fades away, and i don’t want it to snap back up while it fades out). it’s an attempt to recreate the UX of the iOS photos app full screen gallery mode, if you’re familiar with that.
Describe the solution you'd like
so based on that use case, i figured that the dragSnapToOrigin prop could be updated to have the same shape as the drag prop, so if it’s true, the behavior stays the same, but if it’s 'x' | 'y', it applies the snap to only that drag axis.
Describe alternatives you've considered
i’ve been trying to figure out how to combine the carousel previous/next animate prop with the drag prop seamlessly by using _dragX with my own motion value and a useTransform that depends on it and then just providing that motion value to the style prop, but it seems like that will require me recreating my transition prop’s easing along with custom timers and DOM measuring to translate percentages into pixels, which is not something i’m eager to tackle.
Additional context
i think it’s all covered above.