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

What is Framer? Join the Community
Return to index
Sergey Voronov
Posted Jan 08 - Read on Facebook

not sure whether its a bug or its meant to be like that? if I copy layer, states are not copied to new object?

6 Comments

Koen Bok

Yeah for now we don't copy states, events and styles. I guess copying states would make sense.

Sindu Narasimhan

I'd add +1 to that. If we want to override the values it we can always redefine the existing states. I'm curious about new states being defined for the copied layer, and someone calling states.next(). Initial ideas of how you think that could work Koen?

Alexis Morin

I'm hitting this issue now as well. Please update documentation to explain you don't copy states or copy states.
My vote is: copy states onto the new object as well.

Jordan Robert Dobson

I suggest storing your styles inside the custom property...

Layer.custom.style = { style object here }

Then when you copy it...

Layer.style = Layer.custom.style

Anything in the custom property gets copied.

Koen Bok

Jonas nice for upkeep.

Alexis Morin

Finding myself in the same conundrum today.
```
layerB.states.on = layerA.states.on
layerB.states.off = layerA.states.off
```
This works.

Read the entire post on Facebook