You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
On multi-touch devices, the user isn't able to drag multiple elements with Motion with multiple fingers.
Describe the solution you'd like
I'd like the ability to specify that an element can be dragged by a non-primary pointer (i.e. multi-touch input). With a callout that this API would need to work with regular drag prop and the useDragControls method.
Describe alternatives you've considered
If I really want multiple concurrent drags, I would need to write the pointer event handlers manually and maybe recreate the dragConstraints behaviour. I could still use a pair of MotionValue to try to maintain Motion integration.
Additional context
At a glance it looks like the code could be mostly ready to handle this, but there are explicit checks in place that prevent testing this without cloning the library and editing the code myself.
The first is checking PointerEvent.isPrimary for touch inputs, though I think this can be circumvented with Object.defineProperty on the PointerEvent.
The second is a check for !isDragActive() that prevents the above workaround from working. Looks like the packages/motion-dom/src/gestures/drag/state/is-active.ts module would need some refactoring for multiple drags.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
On multi-touch devices, the user isn't able to drag multiple elements with Motion with multiple fingers.
Describe the solution you'd like
I'd like the ability to specify that an element can be dragged by a non-primary pointer (i.e. multi-touch input). With a callout that this API would need to work with regular
drag
prop and theuseDragControls
method.Describe alternatives you've considered
If I really want multiple concurrent drags, I would need to write the pointer event handlers manually and maybe recreate the dragConstraints behaviour. I could still use a pair of
MotionValue
to try to maintain Motion integration.Additional context
At a glance it looks like the code could be mostly ready to handle this, but there are explicit checks in place that prevent testing this without cloning the library and editing the code myself.
The first is checking
PointerEvent.isPrimary
for touch inputs, though I think this can be circumvented withObject.defineProperty
on thePointerEvent
.The second is a check for
!isDragActive()
that prevents the above workaround from working. Looks like thepackages/motion-dom/src/gestures/drag/state/is-active.ts
module would need some refactoring for multiple drags.The text was updated successfully, but these errors were encountered: