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

What is Framer? Join the Community
Return to index
Katie Wu
Posted Jul 21 - Read on Facebook

So I have a tab bar on my prototype, each with ScrollComponent screens, but whenever I happen to scroll and "let go" (end the scroll) over the tabs on my bar, the tab bar registers as Events.Click, and switches tabs. How can I distinguish between a regular TAP event, and the end of a SCROLL event, so I don't get this funky behavior?



Chris Camargo

The tricky thing here is that Events.Click is essentially just the same as Events.TouchEnd. So if your touch event ends over a layer that's bound to Events.Click, you'll get this behavior. A couple of ideas:

1. You could always check to see if the ScrollComponent is moving using scroller.isMoving, but that would prevent the user from being able to navigate away when the scroller is moving at all. Instead, you could try checking scroller.isDragging, and only perform the tab change if its false, but I'm not sure of the ordering of those events... It may switch to false before your event performs that check.

2. You could set your own variable to true on TouchStart when the user is touching any of the ScrollComponents, and set it to false on TouchEnd. Then build logic into your Events.Click function to check that variable, and only perform an action if its true.

Read the entire post on Facebook