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

What is Framer? Join the Community
Return to index
Thijs De Mooij
Posted Jul 06 - Read on Facebook

Hi guys,
When you have a draggable layer which also has a Click event, it fires the click event once the drag has ended. Is it possible to prevent this?


Benjamin Den Boer

Perhaps you could use MouseUp and MouseDown instead of a click? Not sure what you're trying to do exactly, though?

Cemre Güngör

I would look at the _deltas and if it exists not fire the click

Thijs De Mooij

I'm trying to make a card deck, which you can swipe to get a next one, or tap to flip it around...

Алексей Кольченко
Jorn van Dijk
Kostantinos Frantzis

I would refer to hammer.js that allows for multitouch event listeners. This way you could do on even tap or on event swipe. There was a post in the group about it a month ago but here is an example of how you can extend framer with hammer.

Thijs De Mooij

The codepen from Алексей Кольченко worked for me, thanks for all the input!
This is how I use it..

cardHolder.on Events.DragMove, (e) ->
@dragging = true

cardHolder.on Events.DragEnd, (e) ->
@dragging = false

cardHolder.on Events.Click, (e) ->
return if @dragging

Read the entire post on Facebook