UIListLayout Flexes should respect its parent boundaries/borders

When using an UiListLayout Flex on any Frame(or GuiObject), its children will bypass any boundaries and clip through them, this should not happen, should it ever be intentional and is not very ui-friendly.

image

Wraps seems to semi-fix the issue but the fourth element seems to disappear or go below the viewable point.

image

image

The only work-around I found was changing the direction from Horizontal to Vertical, changing the flex to SpaceBetween and then changing the padding, but this is not very practical, since the ui is meant for horizontal scrolling not vertical.
image

Expected behavior

Any UiListLayout children to respect the parent boundaries like always and not go through them/clip.

Hi @weakroblox35 thanks for the report!

I think I understand the issue you’re running into and I believe that this is correct functionality. From what I understand you’re trying to create a UI element that contains multiple smaller frames laid out horizontally in a dynamic fashion. My understanding (and please correct me if I’m misunderstanding something here) is that you are accomplishing this with a parent Frame element (or any GuiObject) with a UIListLayout underneath it. This UIListLayout has its FillDirection set to Horizontal and its HorizontalFlex set to anything other than None.

When using an UiListLayout Flex on any Frame(or GuiObject), its children will bypass any boundaries and clip through them, this should not happen, should it ever be intentional and is not very ui-friendly.

Here It’s a little unclear to me if you are dealing with a child “bypassing” or overflowing over its parent’s boundaries, or clipping (which is what the image you linked looks like you are dealing with). If your parent Frame’s ClipsDescendants property is set to True, than the children should be “clipped” or cut to fit within the parent element’s boundaries. If it is set to False, then the child element will overflow over the parent’s boundaries. From the photo it seems like you have this property set to true and the behavior is correctly “clipping” the child element.

Wraps seems to semi-fix the issue but the fourth element seems to disappear or go below the viewable point.

This is also the correct functionality of wraps. With wraps set to True, any child element that causes the total width of the contents to exceed the width of the parent frame will go to the next row. Then depending on the height of the parent frame, the height of the child element, and if you have ClipsDescendant set to True in this parent element, this element will either be rendered in the row below clipped (as it seems its doing in your case), overflowing (when ClipsDescendant is set to False), or rendered completely if it fits within the parent frame.

But this is not very practical, since the ui is meant for horizontal scrolling not vertical.

If you are looking to create a horizontal scrolling UI, then I think using a parent Frame/GuiObject is not the best way to accomplish that. Maybe instead try using ScrollingFrames.

This example uses a ScrollingFrame with a ScrollingDirection and AutomaticCanvasSize set to X. It also has a UIListLayout underneath it with a FillDirection of Horizontal.

If this is completely off the mark as to your bug, I’d definitely appreciate more context and the placefile so I can get a better understanding for whats going wrong.

1 Like

What I mean was, the frame that has the “see others’ creations” text is going out of bounds, it should not do that, it should be fully visible with an offset to the right, that’s my issue.

That’s what I’m trying to do but Flexes like I said, keep making the frames out of bounds and clip out.

1 Like

Hey @weakroblox35 thanks for clarifying! I’m still struggling to repro your issue, would you mind sharing your place file so I can take a better look? Thanks!

1 Like

Hi, here is a screenshot of the ongoing issue alongside a rbxm of the ui, thanks!


settings.rbxm (20.0 KB)

Hi @weakroblox I see the bug now, and its closely related to when the parent element with the UIListLayout is a ScrollingFrame. We are currently working on a fix for this issue. Just to confirm on your end, when you change the HorizontalFlex property on the UIListLayout to SpaceBetween, does this mimic the behavior you are looking for? I tried this on my side and was able to produce a Scrollable window where the leftmost element is not clipped out and starts in bounds (see below).

1 Like

Yes it does! That’s what I’m looking.

Hey @weakroblox35 thanks for your patience! After investigating the bug further, it seems like we don’t plan to fix this in the near future as we need to perform further exploration on how to resolve this issue without causing issues with backwards compatibility. I hope the workaround of using HorizontalFlex: SpaceBetween is sufficient for now, and please let me know if you have any questions.