Component instances are not getting "fill" property inherited from main parent component

I’m trying to use Figma auto layout wrap with components inside. I set the parent component width to have a fill property and set min-width and max-width values but the instances of the parent component are not inheriting the “fill container” property. Due to this minor issue I have to manually select every instance ( children components ) within auto layout and set the width to fill. Then it works. Why do I have to do this? why can’t I inherit the “fill container” from parent component?

1 Like

Hey Elmiur, thank you for reaching out! Could you send me a screen recording of what you’re seeing on your end please?

If those components have no parent structures, i.e. they’re variants or main components, their fill property will not pass on to instances because they have no parent to reference their width from, so they automatically go into Hug mode, even if you place it inside an autolayout frame. Unfortunately this is unwanted behaviour but it is as Figma has always behaved in this case. Figma really should “touch” the components when they’re dragged from the component picker or library browser to have them fill according to their original rules depending on where they are being placed.

1 Like

Yep they don’t reference the parent element to set the child component to fill where they are used. Setting fill property at a main component level seems useless.

I have the same issue. Is this a bug?

Hey there, could you share a screen recording or a link to your file with us? So we can take a closer look at it.

Hi yes, here is a screen recording.

Following !

We have the case on a slot set to fill inside a design system file

1/ we call the component from our library to build our page on another file
2/ we swap the slot with our custom-content
that is usually a single-component for this area that is set to fixed by default after a ctrl/cmd + K
3/ the behavior of Figma is to swap the content but inherit from the previous slot setting, so our previously fixed custom-content inherit the fill from the slot

→ because we are used to this we manage around this and it’s ok for our usage, and we can change to hug or fixed as we need.

BUT our design system team decided to change to a slot with a hug content setting

Now, with a slot set to hug, when we swap it, it doesn’t inherit from the hug setting and let our custom-content still be in fixed setting and also doesn’t let us the option to fill container.

We then could do a fake variant of our custom-content to create a container, that is set to fixed to encapsulate it and unveil the fill-container setting, this workaround is working when we’re inside the design system file

Alas, it doesn’t when we’re consuming the design system component from another file, and we have to click our life to enter each slot setting to override them.

Can we fix the fill/fixed/hug behavior be always inherited or never inherited consistently?

3 Likes