Jump to content
Search Community

Draggable onDragEnd not firing

geddski test
Moderator Tag

Recommended Posts

I recently upgraded an app to gsap 3 and found that my Draggable instance never fires its onDragEnd event. The other events (onDragStart and onDrag) fire just fine. 

 

I tried onRelease event also and it doesn't fire either. I'm using React 16.12 and found another post about needing to use dragClickables: true option, but that didn't help. 

 

In case it's relevant, I'm using:

this.draggable.startDrag(originalEvent);

 

to initiate the dragging, as it's a dynamic element that I create rather than one the user touches. 

 

Any ideas?

Link to comment
Share on other sites

Hey geddski and welcome. Thanks for being a Business Green member - we couldn't do what we do without people like you.

 

Can you please create a reduced demo to exemplify this issue? Maybe on Stackblitz or CodeSandbox? It's hard to help blindly. I can't recreate the error solely from your description as seen in the pen below:

See the Pen gObJdXY?editors=0010 by GreenSock (@GreenSock) on CodePen

Link to comment
Share on other sites

Ah, the problem was that you were listening for a mouse event in a browser that supports pointer events which are prioritized in Draggable (and the browser). I've made an adjustment to the next release that should resolve this. Demo: 

See the Pen 90377d50d93801e813f20347c1a2fe13?editors=0010 by GreenSock (@GreenSock) on CodePen

 

A preview of that next release of Draggable can be found at https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/Draggable3.min.js

 

Better? 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...