Figma Support Forum

Why do auto-layout setting reset when swapped to a particular component variant?

See video: Untitled - Figma 2021-02-03 15-43-34

I have the following mock setup:

Content - A simple component that contains content.
Layout - Auto-layouted component with a header, grid placeholder, and a link (marked with red for illustration purposes).
Content blocks - Pre-made combinations of content that I intend to swap out the placeholder instance in “layout” for.

All the content blocks have their autolayout height set to “hug content”. The placeholder instance has its height set to hug content. When I start swapping out the placeholder for blocks, you can see how the entire instance grows and shrinks vertically, as intended. However, when I swap for the 1280px variant, then suddenly the instance autolayout height is set to “fixed” which breaks vertical layout as you can see with placeholder instance not growing after the content block height.

Why does the instance reset to “fixed” height despite both the variant and instnace it is swapped into have their height set to “hug content”? The only difference is that one is auto-layouted vertically and other horizontally, but why would it matter?

File: Figma

:sweat_smile: Hey @miggi

1 Like

Just seeing if maybe I am doing what you are intending.
I added a video as well. So you can see me attempting what I think you are attempting.

  1. I replace the grid place holder component with your component with variants
  2. Swap the variants in the properties menu
  3. It seems to be adapting the heights when changed

Please clarify, If I am not reading the question correctly.

Thanks

1 Like

Hi Miggi, thank you for looking into it!

Actually, you got it exactly right and I have no idea why it is suddenly working as intended in both your video and in the document, but when I try replicating the behavior in another setup I added above the old one in the linked doc, I am back to the 1280px switching to “fixed” when the variant is activated. See the video.

Am I missing something in the setup, or is this some random bug I can’t get away from?

Bump, anyone knows what could be causing the bug those some times but not others for Miggi?