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

What is Framer? Join the Community
Return to index
Jon Madison
Posted Apr 17 - Read on Facebook

aside from destroying and recreating a ScrollComponent, what's the most idiomatic way to "reset" a ScrollComponent? no dice on what i thought would make sense

scroll.content = null
scroll.children = null (feels dangerous, but regardless didn't work)

hopefully i'm just missing something. thanks!


George Kedenburg III

reset how?

Stephen Crowley

You mean change the content of the scroll component or remove the content?

Steve Ruiz

Check out .updateContent(). It will run the same routine as when a scroll component is first created, to determine a scroll component's height and limits. Useful for 'resetting' a scroll component after its content has changed.

Jon Madison

Sorry for not explaining well, I hope I did in a comment above.

Brian Williams

Ok finally got round to looking at this. Why not have a layer with children each a scrollcomponent.

Then what you can do is set the visibility based on selection. Either by iterating through the collection and setting all the other layers to false (slow) or just keeping track of the currently visible layer and remembering to set its visibility to false when you swap over to the new one shouldnt be hard to write a function that does it.

Brian Williams
Read the entire post on Facebook