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

What is Framer? Join the Community
Return to index
Christian Hagel
Posted Aug 01 - Read on Facebook

I'm running into a discrepancy in what subLayers returns between Framer Studio and the Browser

Framer Studio returns name, the browser does not

print myLayer.subLayers

Here are two samples

Framer studio:
<Header_col id:101 name:fb_pain_header (1406,202) 602x50>, <Label_medium id:102 name:fb_pain_byline (1406,272) 602x50>

Browser (Chrome & Safari on Mac, Chrome on Windows)
<Header_col id:101 (1406,202) 602x50>, <Label_medium id:102 (1406,272) 602x50>,

Any ideas for ways I can work around this? Specifically i'm using childrenWithName to find a layer and bring it to the front.

3 Comments

Koen Bok

This is very hard to debug without looking at the code. Any chance you could share it?

Niels van Hoorn

I've hunted this down, and you're right: The behaviour of studio is different then in shared prototypes.

But unfortunately the bug is that Layer.name should never contain the name of the layer if it's not set explicitly, so you can solve this by setting the names of your layer explicitly in the constructor of the layer. We probably will remove the automatic setting of name in a future version of Studio.

Christian Hagel

Thanks Niels, Thanks for looking into it. And thanks for the suggestion for how to fix it, I should have thought of that.

Read the entire post on Facebook