Description
I’ve never noticed this before, but if you have a UIListLayout with gui elements and the 1st element’s Visible property is set to false, it will add extra padding to an automatic sizing parent frame when it is not supposed to. This still happens as of 20 November 2023.
It is easily reproducible and explained on how to replicate and examples below.
Replication and Examples
Here is an example of a UI of it working properly:
Frame has it’s Size set to {0, 0},{0, 0} and AutomaticSize set to XY.
Inside it is a UIListLayout with it’s Padding set to 0, 10, SortOrder set to LayoutOrder (note that this still happens with the Name SortOrder), along with 3 TextLabels with it’s LayoutOrder set accordingly.
TextLabel 2 and 3’s Visible property set to false, working as expected:
TextLabel 1’s Visible property set to false, adding an extra padding of 10 pixels on the bottom:
TextLabel 1 and 2’s Visible property set to false, still having the same padding issue:
Real Examples
Working as expected:
1st elements are removed:
Conclusion
Any combination of elements will work properly as long as the 1st element’s Visible property is set to true.
One way to combat this is completely destroying the element if it’s not visible, but it is much easier for me to tick a property rather than recloning elements.