cbert Posted March 12, 2021 Share Posted March 12, 2021 Hi there, I'm using Draggable with inertia true. The onClick event gets triggered every second time I drag an element (more than 3 pixels), which I thought it should not. With inertia false, it works as expected -> onClick only gets fired if element has not moved more than 3 pixels. Do you see if I do anything wrong here? The example here can't load inertia plugin, but you see my code: https://svelte.dev/repl/c20bf7a911064883a0726c0946d92662?version=3.35.0 Thanks in advance and best regards, Christian PS: Does anyone know how to run svelte on CodePen? Link to comment Share on other sites More sharing options...
GreenSock Posted March 13, 2021 Share Posted March 13, 2021 I believe I figured out what might be causing the issue you described, and it would only happen with type: "top,left" when the coordinates contain a decimal. It should be fixed in the next release which you can preview (compressed) at https://assets.codepen.io/16327/Draggable3.min.js Does that work better for you? (and no, I don't know how to run svelte on CodePen, sorry) 2 Link to comment Share on other sites More sharing options...
cbert Posted March 13, 2021 Author Share Posted March 13, 2021 Thanks for the quick response, that is truly amazing speed :-). I tried to replace your file with the /node_modules/gsap/dist/Draggable.min.js and also then tried to replace the non-minified version. Not sure if that's the way to do it, though? Both lead to the same behaviour as before (meaning click event was fired). I also tried to switch to x, y and as far as I can tell I had the same issue. Please let me know if I can help with other testing scenarios! Link to comment Share on other sites More sharing options...
GreenSock Posted March 14, 2021 Share Posted March 14, 2021 Hm, I can't reproduce that behavior at all. Here's a CodePen with pretty much exactly the same code - are you able to reproduce the issue? See the Pen 9067586d0384aa846df370ca43a804c7?editors=0010 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
cbert Posted March 14, 2021 Author Share Posted March 14, 2021 Are you using 3.6.1 here or still 3.6? Link to comment Share on other sites More sharing options...
Solution cbert Posted March 14, 2021 Author Solution Share Posted March 14, 2021 I think I found the issue. My implementation triggered Draggable.create multiple times which lead to this behaviour (basically click event was fired multiple times due to this). But thanks for the quick response! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now