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

What is Framer? Join the Community
Return to index
Yohan Baillet
Posted Jun 23 - Read on Facebook

Hey guys,
I have a layer where a pinch event is used to zoom / resize and a tap event is used to do something else.
The problem I have is when you stop pinching it auto triggers the tap event as well... so what is the best way to prevent tap event to happen when user is pinching on the same layer?

1 Comments

Benjamin Den Boer

Hiya Yohan Baillet! Ah, I see. An easy way to do this is by creating a little flag. Let's call it "pinchEnd". It's false by default, but whenever the pinchEnd event actually fires, we set it to true. Then, within our tap event, we can check whether this flag is set to true or false — and only then execute our code. :-)

See this little example: http://share.framerjs.com/2b473wx0zdyx/

Read the entire post on Facebook