touchable icon indicating copy to clipboard operation
touchable copied to clipboard

Can you add GestureDragEndCallback?

Open jifflisLIG opened this issue 5 years ago • 10 comments

jifflisLIG avatar Jun 17 '20 14:06 jifflisLIG

GestureDragEndCallback doesn't contain the location details (x and y positions) which limits me from detecting which shape got this event.

You can still achieve this by using the onTapUp callback and keeping a flag that becomes true once the GestureStart event is fired.

nateshmbhat avatar Jul 06 '20 11:07 nateshmbhat

@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.

Do you have any idea why this might be?

Thanks for any help!

jackforesightmobile avatar Feb 08 '21 10:02 jackforesightmobile

Hi, I'm also looking for this feature. For me personally, it does not really matter where the "end" event was I just need it recorded.

shymek avatar Apr 29 '21 21:04 shymek

@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.

Do you have any idea why this might be?

Thanks for any help!

If you're still fighting with this I just wrapped the CanvasTouchDetector in a Listener widget and I'm listening for onPointerUp event and just passing it on in the meantime. Hope that helps!

shymek avatar Apr 30 '21 06:04 shymek

Also request this feature

repitch avatar Jun 18 '21 23:06 repitch

Would be great, makes drag & drop behaviour possible.

AncientPixel avatar Aug 11 '21 11:08 AncientPixel

@nateshmbhat I have tried to implement this using the onTapUp callback, but this callback is only fired when I do a quick click on the shape. It isn't fired when I stop dragging the shape.

Do you have any idea why this might be?

Thanks for any help!

Solved this issue by creating another transparent Rect that acts as a background and setting all other shapes with translucent touch detections. Then when a shape is touched a flag is set so that when the background recieves the touch it acts correctly according to the shape that was touched.

EmmanuelMess avatar Aug 22 '21 23:08 EmmanuelMess

I still wish there was a onPanEnd callback on shapes.

AncientPixel avatar Nov 04 '22 10:11 AncientPixel

I still wish there was a onPanEnd callback on shapes.

me too. I can't control this action. very laggy when try moving the canvas inside.

ducchungtx avatar Dec 10 '22 09:12 ducchungtx

What if we save a shape when drag starts on it and call onPanEnd on that shape when drag ends? I tried to implement this feature for drawRRect only so far: https://github.com/autolainen/touchable Please have a look and if my approach is acceptable I'll implement this feature for all the draw* methods.

Created a PR: https://github.com/nateshmbhat/touchable/pull/61

autolainen avatar Oct 16 '23 12:10 autolainen