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

What is Framer? Join the Community
Return to index
Zachary Russell Heineman
Posted Feb 20 - Read on Facebook

Is it possible to 'ignoreEvents' for specific events? I have a 'Click' and a 'DragEnd' listener on a given layer, and they both fire on the click and are messing up my logic.

6 Comments

Nikolas Moya

I solved this once by checking the drag displacement. If the displacement is zero, it was a click, not a dragEnd. You can compute the displacement saving the initial position with the DragStart event

Zachary Russell Heineman

I solved it for now by ditching the 'Click' listener and leaving the 'DragEnd' listener with the 'draggable.speedX/Y' set to '0'. Seems kind of hacky though...

Nikolas Moya

I see. But if you need the click event for another effect, you cannot ditch it. My problem was to simulate a swipe movement over cards and the click would turn the cards facedown. The displacement was a good alternative to check if the touch was meant for the swipe or turn action.

Jordan Robert Dobson

You can set ignore events on touch events too.

Jordan Robert Dobson

You can also set a variable flag. HasDragged = true then use a delay to clear it after drag end.

Jordan Robert Dobson

There's a few ways you could solve it.

Read the entire post on Facebook