#Trouble with the animation (search bar)

12 messages · Page 1 of 1 (latest)

robust topaz
#

Someone knows why this animation its horrible?

gray oak
#

Hey @robust topaz ! Were you using ellipsis to make the circle and stuff? You might want to just use a frame / rectangle and have border radius on it (probably a frame though)

robust topaz
#

I'm using auto layout

gray oak
#

Could you show the layers for this?

robust topaz
#

Yes. I've applied a stroke to this frame with rounded corners and I've created variants for it

gray oak
#

oh okay i have been trying to replicate it now. It seems like when you are making it grow to the left it doesnt really wanna work out

robust topaz
#

Do you have it same problem ? @gray oak

peak beacon
#

Animations relies heavily on layers and names of elements - could you share some more information, or copy paste the component to a file you can share?

gray oak
#

@robust topaz @peak beacon i actually could recreate the problem and it doesnt seem to be a layer problem exactly. To recreate it:

  1. Make a frame with 100px border radius and have like a number 1 in it. Also add a stroke on it. And have autolayout on it to and make it hug the number. - like a number in a circle. Have the position of the number to be on the left (with autolayout) this is more important for step 4

  2. Put this into another frame (like a bigger one). Do it in a way that the cirlce one is on the right of this rectangle frame.

  3. Copy paste the result from 2

  4. Drag the left side of the circle more to the left to stretch it out.

  5. Combine them as component variants

  6. Set up change to from one to another with smart animation

  7. Make another frame and put in one of the variations

  8. Preview this frame and see the problem

The reason why you need to put the circle frame into a bigger one is because as default, in figma it would grow to the right and not to the left. With that, this works well and doesnt look weird. It seems like when it needs to grow to the left (with this setup) it kinda breaks the animation and doesnt work well. But this feels more like a bug or figma limitation

#

I hope sometime they would make <- for autolayout too and not just ->