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

What is Framer? Join the Community
Return to index
Arron J Hunt
Posted Oct 02 - Read on Facebook

After removing a page from a PageComponent (using layer.destroy()), how do I update the size?

pageComponent.updateContent() doesn't do anything.

6 Comments

Fran Pérez

Yes, it does. It should update the size of pageComponent.content.

Arron J Hunt

Must be doing something wrong http://share.framerjs.com/vabxz2qj2tny/

Arron J Hunt

Fran Pérez every time a page is removed I try to update the content for the PageComponent, but it still retains the original size.

I'm trying to build a page component that allows you to remove pages and have it adapt to the new count

Fran Pérez

So I did this some time ago (swipe up to destroy): http://share.framerjs.com/wnmdapv3tton/

There are some bugs, but it does pretty much what you are describing. The pink layer is the pageComponent.content, you can see how it shrinks every time a layer is destroyed.

Jordan Robert Dobson

I might try doing a short delay of zero seconds before you call updateComponent()

Jordan Robert Dobson

Arron J Hunt I think you have to resolve the x positions yourself. There is no remove function.

Read the entire post on Facebook