Skip to main content
Antoine
Active Member
May 19, 2022 12:11 PM UTC

"Empty" Auto Layout Frame keeps the size of last hidden child

Hi, I’m not sure if this is new since the May update, but I wonder why “empty” (all elements hidden) Auto Layout Frames keep the size of the last hidden child (and I do not mean last in the list, but the last element to have been toggled out of view by the user), making them not-0px high even with nothing in them.

See here a file with a Frame with three hidden rectangle: the Frame keeps the size of the last child rectangle to have been hidden. When adding a 0-px Frame to the AL frame, and toggling this 0-px Frame off last, the container goes 0-px.

In my opinion, empty AL Frames should have a height of 0. What do you think?

Pinned Reply By djv

Hey All, thanks again for your continued feedback, and I finally have an update!

 

As mentioned previously, this is behavior is currently a known feature limitation in Figma. We do not allow Auto layout frames to collapse to 0 when the child layers are hidden, so it is expected that the frame will remain sized as if they were shown.

The team has confirmed that they now have the bandwidth to get this working as expected. In the meantime, they have a temporary solution: Add a visible zero-sized frame. Since the container is then not empty, it will hug to the visible child, which is zero-sized.

 

While I know this may not be the solution you want, please know that we’re getting closer. I’ll be sure to update you all again once we have a more firm timeline on the fix. 

129 replies

Nelson_Vasconcelos2
Dec 22, 2023 8:20 PM UTC

This is a very frustrating bug and should be fixed. It affects the usage of boolean properties.

Philip16
Dec 23, 2023 5:48 PM UTC

Ran into this error today as well… It was not that big of a deal, since i just built a separate component for my case, but still when you are in the hour before the deadline of your final Bootcamp presentation, these kind of bugs aren’t something you want to figure out in this kind of situation… 🤭

FlorianModel
New Participant
Dec 26, 2023 6:16 PM UTC

Bot sure if it’s a bug. I often use empty AL containers similar as one would use an empty div container: A placeholder for things that might appear in that section but are currently not visible.

MichaelF
New Participant
Feb 6, 2024 8:20 AM UTC

bump so that this topic will not auto-close.

stevekulaga
New Participant
Feb 12, 2024 4:49 PM UTC

+1. This bug forces me create another frame with another boolean prop to hide the empty frame.

Aaron5
Feb 15, 2024 4:39 PM UTC

+1. This is super frustrating. A container set to size to its contents that has no contents should be zero.

I have a stack of components that I need its autolayout parent container to hug vertically, and it can’t because its children are taking up phantom space. Makes no sense.

Seamoose
New Member
Feb 15, 2024 10:31 PM UTC

I cannot believe this is the condition of this feature.

Andrew_Elliot
New Member
Feb 22, 2024 9:54 AM UTC

Just encountered this too. This should behave the same as CSS whereby display: none child elements don’t affect the height of the parent, so the parent collapses in height if all children are not displayed

Dustin_Hansen1
New Participant
Feb 26, 2024 4:56 PM UTC

Just adding another +1 to keep this issue open

If the frame height is set to “Hug” it shouldn’t have a height when it’s empty or when the elements inside it are hidden.

Ben_Smeets
Active Member
Feb 29, 2024 8:53 AM UTC

This is the challenge with Figma lately, all the focus goes to random new “features” but less attention to stuff that (even after years) is still not working 100%… sigh.