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

What is Framer? Join the Community
Return to index
Ed Lea
Posted Aug 27 - Read on Facebook

Trying to only listen to a Click event, but DragEnd is always fired (even if no dragging occurred)

However, if you drag, then the Click event is not fired. http://share.framerjs.com/rxiq8f108sz9/

How can I call something from the Click event, without also triggering the DragEnd?

9 Comments

Min-Sang Choi

checking with layer.draggable.isMoving?

Joon Won Lee

:)

Ed Lea

Joon Won Lee DragEnd doesn't get called at all then. I still want to DragEnd to fire, but only after actually dragging. Is that the expected behaviour of "off" as it's not working for me.

Ed Lea

Min-Sang Choi neat idea, I'm using that for now. Problem is that you might want to click while something is still moving (especially with an ease out, something can look still but still be moving for some time). I think I might move the detection to mouse movement Vs object movement.

Min-Sang Choi

Ed Lea yeah, right. isDragging might be also good one to check? http://share.framerjs.com/4shm3modbb70/

Ed Lea

Thought of another option that seems to work. Checking if a drag actually happened with DragMove http://share.framerjs.com/uby7ewv95lgz/

Ed Lea

Min-Sang Choi your version totally works also. I'll test out both and see which is more robust.

Min-Sang Choi

Ed Lea sure thing, btw next time we should definitely say hi. I was in 1950-4 for last 2 months!

Joon Won Lee

Oh ~
isMoving, isDragging properties seem quite useful!
Thank you guys :)

Read the entire post on Facebook