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

What is Framer? Join the Community
Return to index
Lukas Guschlbauer
Posted Aug 25 - Read on Facebook

Okay, seriously guys... what's wrong with the "default" state? It seems like everybody knows about the hickups you have when working with the default-state (stateCycle etc..) (Also Tess Gad wrote about it in here States Cheat Sheet [https://blog.framer.com/framer-cheat-sheets-states-9b4c96b89674])

Is this gonna be fixed? What's a smart workaround? Can I somehow "repair" the default state?

5 Comments

Lukas Guschlbauer

I'm bypassing the issue for now by doing this:

@.on Events.StateSwitchStart, (from, to) ->
if to is "default" and ((@.states[to].x isnt @.x) or (@.states[to].y isnt @.y))
@.states[to].x = @.x
@.states[to].y = @.y

Not a perfect solution, but works for me, until it doesn't..: ;)

Sigurd Tapio Mannsåker

What exactly is wrong with it? I haven't used states all that much, so I hadn't noticed anything yet myself.

Ivo Ruijters

Same here. My issue is the x value seems to change on every cycle

Lukas Guschlbauer

Sorry for the rant and not going into detail with my problem. The default state should be in sync with the layer-properties, but in some cases - especially when cycling to default-state - it seems that the correct position (x,y) gets applied at stateswitchend, and before that it animates to the position you gave the layer on initialization.

I'll create a demo when I find the time!

In the snippet I posted above, I override the x and y values of the default state before the switch happens, which works alright...

Niels van Hoorn

I would really love to fix this, but am not sure what the problem is exactly. An example would be mighty helpful.

What can cause some confusion is the time the default state is created. Because you would expect that to be during the creation of the layer, but it's actually at the point you create the first state.

We do this because you might want to change some properties of the layer after the constructor, that you also expect to be captured inside of the default state.

Read the entire post on Facebook