Skip to main content
Solved

Cannot get nested component to preserve "Hug"

  • January 24, 2023
  • 5 replies
  • 749 views

Christian_Knoflach

I have a nested component system, where I swap out inner components for different content. These inner components have different heights.

Every single element in the structure of the components has an Auto-Layout, and they all are set to “Hug” (the height is defined within the innermost-level component). However, when swapping out the content component, its height property is always changed to “Fixed”.

I checked every element, and all of them are set to “Hug”.

Only once I swap the nested component, “Hug” changes to “Fixed”.

It is changed with the swapping of the component, no matter what component I swap in. Manually re-changing the property to “Hug” fixes the issue, and I can from then on swap out the content, and “Hug” works & persists.

Best answer by djv

Hey All, sorry to hear you’re having trouble with this!

It’s hard to be sure what’s happening without seeing how your files have been set up. Please reach out to the technical quality team directly via this form for help: https://help.figma.com/hc/en-us/requests/new

Be sure tp use your Figma account email, include a link to the file, and share it with support-share@figma.com, so they can take a closer look.

View original
This topic has been closed for replies.

5 replies

Carmen_Branje1

I’m having this same problem.

No solve for this yet?


Thought it was just me and something I was doing wrong but does seem like a bug.

I’d rather just be using one component with properties rather than variants for something this dumb. Swapping variants for size is easier than manually changing but won’t be great for future scaling.


I think this bug has been around for years and now I have to undo a bunch of work because it’s not viable. It’s kind of odd that parent components don’t respond to child instances’ sizes, since that’s kind of an important aspect of nesting components.

Can this be fixed, please?


djv
Figmate
  • Community Support
  • 4779 replies
  • Answer
  • March 14, 2024

Hey All, sorry to hear you’re having trouble with this!

It’s hard to be sure what’s happening without seeing how your files have been set up. Please reach out to the technical quality team directly via this form for help: https://help.figma.com/hc/en-us/requests/new

Be sure tp use your Figma account email, include a link to the file, and share it with support-share@figma.com, so they can take a closer look.


Joris_D
  • New Member
  • 3 replies
  • October 28, 2024

Did you had a fix?
Having a similar issue with nested components having a fixed size and the component they’re in that should hug them.

Stupid thing is it works on the master component and when I swap out the nested component works, but not on a instance of that master component.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings