What is the best way to make a ScrollComponent stop scrolling at a certain scrollY and make it stick to fixed value? I want to build a pull-to-refresh animation with the ScrollComponent
Scroll.on Events.Move, -> if Scroll.scrollY > 500 Scroll.scrollY = 500
tried this, but what if i do this in the negative direction? It always snaps back to zero
scroll.on Events.Scroll,-> if scroll.scrollY <= -200 scroll.scrollY = -200
First, you need Events.Move
I want to build a pull-to-refresh animation
For negative values it doesn't work Anton Jarl
Nope, needs some more stuff. Hang on.
You'll still need to add the animation but here is a start: http://share.framerjs.com/839675za732z/
Exactly. The problem with using .Move is that it fires all the time. As Jonas said, it's better to use the onScrollEnd.
The next thing is to animate the whole scroll component down, also in Jonas' example!
Yes, that will do :-) thank you!