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

What is Framer? Join the Community
Return to index
Bimma Bimma
Posted Aug 29 - Read on Facebook

I hope I can ask this question clearly ...

If I've created a module with a class that has layers with onClick events, and those (module class) layers are included in a scrollComponent in app.coffee, how can I prevent the click event from firing on those layers when the user is scrolling the list?

I'm clear on how to do this when NOT using a module, but this is clearly a scoping issue I can't figure out. I've tried passing the scrollComponent to the module as a parameter. I've tried using window["variable"]. To no avail. Scrolling always triggers one of the layers created from the module class.

5 Comments

Bimma Bimma

No one?

Jorn van Dijk

Can you share your file with us?

Bimma Bimma

Yes, project is large but I will post a fragment here when I get to the office. Thanks!

Bimma Bimma

Jorn van Dijk - per your request, here's a stripped down Framer build showing the issue I'm having. Appreciate any help! http://share.framerjs.com/7wbu3i8d13uo/

Floris Verloop

The click is triggered because you also listen to "TouchStart" and "TouchEnd" in your module. I assume this is because you want to mimic a long press. Framer actually has a "LongPress" event available.

I've update your module a bit so it now uses the LongPress event (see line 22 in module), and everything works as it should: http://share.framerjs.com/qprjdh5g9xm9/

Read the entire post on Facebook