This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Benedikt D Valdez Stefánsson
Posted Mar 11 - Read on Facebook

So now I'm dealing with dragging boxes, and said boxes need to be clickable as well. Can think of it like this, if I drag it far enough to the left, action A happens, if I drag it far enough to the right, action B happens, and click, action C happens. My problem is this - Most of the time when trying to trigger A or B, C is triggered as well.

Q: Is there any way to detect if my box has being dragged and prevent the click handler from firing only then?

In this working demo I'm simply resetting the box position on Event.DragEnd, and toggling between blue and red backgrounds for the box on click. Link to demo: http://share.framerjs.com/eytziaqp790j/

2 Comments

Koen Bok
Benedikt D Valdez Stefánsson

Awesome - feels so obvious when you see it like that :) thx!

Read the entire post on Facebook