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

What is Framer? Join the Community
Return to index
Julia Carlson
Posted Apr 10 - Read on Facebook

Happy Friday! Is there a way to disable autosize on TextLayer? It's proven very useful when I want to size the text to the container but there are cases where I want the container to size to the text.

3 Comments

Jesse Campbell

Should be as easy as setting the width of the TextLayer like `myLayer.width = container.width`.

Julia Carlson

The problem is I want to set the container width based off of the text and I can't do that when the text is constrained by the container. container.width = textlayer.width

Jesse Campbell

Took a bit of digging into the TextLayer class, but try this. It essentially runs the "autosize()" function built into the TextLayer class on the container. Not super proud of how this looks, but hey there y'go.

Read the entire post on Facebook