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

What is Framer? Join the Community
Return to index
Arkadiusz Janeczko
Posted Dec 21 - Read on Facebook

Hi group, i have a problem with position dynamic layers.

When i set 'auto' width of layer by using .style properties, and then try to get a width of this layer which is unknown until it gets a text from parse in html propertie, it is always returning default value of '100'. I am trying to do something like:

storyMetaInfoCategory.html = result.attributes.articleCategory = 'auto'
storyMetaInfoTopic.x = storyMetaInfoCategory.width + 20

In this case storyMetaInfoCategory layer is covering all the long text, but in inspector it shows a width of 100. What i am missing ?


Jorn van Dijk

Hey Arkadiusz, thanks for reporting! I get that this is confusing. Framer doesn't 'listen' to style properties. We're working on a new utility that should help you do this called Utils.textSize(text.html, style) but it's still in beta and undocumented. Sorry about that. Koen, can you confirm if we'll be able to listen to style properties like these in the future, so we can fix:

Koen Bok

The answer is kind of no... Framer makes some guarantees on performance etc, but we can only do that when we control the css. You're always free to edit the .style property yourself, but might lose some of those guarantees (or things can generally get messed up).

Arkadiusz Janeczko

Thanks Jorn van Dijk Koen Bok! Fortunately i have fixed number of categories so i can determine what will be the width of output. But i think it would be great advantage to be able to determine width of dynamic layers using something in utils. I encountered this problem a few times so far.

Read the entire post on Facebook