-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dragging problem / Minimal drag example #16
Comments
It's not so clear for me too... |
Ran into this issue and was able to solve it with a hackity-hack™️ (as of This issue is fairly stale (is this package still supported?) Either way, commenting my "solution" for next person who finds this issue. If there's a proper/better way to do this please share! gestureModule.config.drag.initial = [x, y]; Example Usage: const gestureModule = useGesture(
{
onDrag: handleSurfaceDrag,
onPinch: handleSurfacePinch,
onHover: handleSurfaceHover,
onWheel: handleSurfaceScroll,
},
{
domTarget: surfaceEl,
eventOptions: { passive: false },
}
);
function handleSurfaceDrag({
movement: [x, y],
dragging,
}: {
movement: [number, number];
dragging: boolean;
}) {
if (!dragging) {
return;
}
doSomething({x, y});
// update initial point for next drag
gestureModule.config.drag.initial = [x, y];
} I also ran into this issue with gestureModule.state.wheel.values = [x, y] |
@rafaellehmkuhl have you got around this issue? were you able to use |
I gave up on this one and I'm now using vue-draggable-plus. It's pretty good, and maintaned by one of vue-use contributors. |
I'm trying to reproduce a minimal drag example, where the user can drag a component somewhere, and it stays there. Problem is: the first time the user drags the component, it stays there, but as soon as he tries to re-drag the component, it goes back to the (0,0) position and begins the next drag from there.
My code is the following:
The text was updated successfully, but these errors were encountered: