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

What is Framer? Join the Community
Return to index
Naheel Jawaid
Posted Feb 11 - Read on Facebook

Is it possible to have an onTap and an onDoubleTap event listener on the same object?

I tested with print statements and onDoubleTap it detects both the double-tap as well as two single tap events.

4 Comments

Naheel Jawaid

There is a thing called SingleTap in the Framer docs, but now it says

Jonas Treub

Hi Naheel! I just tested both events and the onDoubleTap is only called with a double tap. The tap event gets called two times during a double tap.

layer = new Layer point: Align.center
layer.onTap -> print "tap"
layer.onDoubleTap -> print "double tap"

Naheel Jawaid

Hi Jonas Treub

Yeah exactly!

Doesn't this cause some problems if you want to have different actions for a single-tap and for a double-tap on the same layer?

It will call the single-tap action twice as well as the double-tap action when you go to double-tap it.

Some other languages have a onTapConfirmed which let's you separate the single-tap so that it doesn't fire during double-tap. Was wondering if there's some equivalent in Framer studio.

Naheel Jawaid

I hacked together something for my own project which people might find useful.

I changed the single-tap to a long-tap.

So now I have a long-tap, double-tab, and drag event on the same layer.

To get the drag event and long-tap to not overlap, I hacked together the following code.

Read the entire post on Facebook