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

What is Framer? Join the Community
Return to index
Brandon Shepherd
Posted Dec 29 - Read on Facebook

I'm having a problem with a Scroll Component and using the function scrollToPoint. No matter what value I give the Point (the position it should scroll to), it always scrolls to x: 0, y: 0. See sample. (Here, I'm only trying to change the y position of the content. Just tap anywhere to activate the scrollToPoint function which should send it to 0,-300)

9 Comments

Brandon Shepherd

The Code:

Radek Kyselý

Whitespaces are important in CoffeeScript.
Delete ›space‹ after scrollToPoint call and write in the positive value of 300.

Radek Kyselý

Also, it's more convenient to watch scroll component position, not its child .content :)

Brandon Shepherd

Worked like a charm!

Radek Kyselý

Brandon Shepherd

Just a quick question, why is it 300 instead of -300?

Radek Kyselý

You can see in my screenshot of code.
›scrollToPoint‹ is a function that manipulates the component itself, not its child ›content‹.
You saw negative values on change:y, because you looked at the child's position (which indeed went negative).

Brandon Shepherd

Yea, I just realized why

Brandon Shepherd

Thanks for your help!

Read the entire post on Facebook