Skip to main content
Svarry
February 3, 2021
Question

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

  • February 3, 2021
  • 12 replies
  • 2774 views

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

This topic has been closed for replies.

12 replies

Dave_Nelson
New Member
March 25, 2024

@Junko3 I think I have figured it out, the unrelated changes I have been making are not unrelated.

When changing the auto layout settings of a nested object any parent objects “Fill,” “Hug,” and “Fixed” settings may be changed to accommodate the changes to the nested object.

Figmate
March 26, 2024

Hi @Dave_Nelson, Thank you for replying. I’m glad that you figured it out!