AutomaticCanvasSize doesn't work with UIGridLayout

Reproduction Steps
In the attached place there is a ScreenGui in StarterGui, with a ScrollingFrame that contains a UIGridLayout and elements. The elements are distributed across 5 rows, but only 4 rows are visible / scrollable-to when using AutomaticCanvasSize property on the ScrollingFrame.
Repro.rbxl (35.0 KB)

Expected Behavior
I expect to be able to scroll to see the 5th row of Item frames in the ScrollingFrame.

Actual Behavior
I can only scroll to see the 4th row (out of 5) of visible elements in the ScrollingFrame.

Workaround
The issue occurs when using a UIGridLayout.CellSize.Y={0, 0} along with UIAspectRatioConstraints in the Items to force them to have a height, if another setup is used the issue resolves itself.

Issue Area: Studio
Issue Type: Display
Impact: Moderate
Frequency: Constantly

1 Like

Try placing the UIAspectRatioConstraint inside of the UIGridLayout rather than inside of each individual TextButton.

1 Like

Thanks that works as a workaround and I like it but it seems undocumented?
As in here where it mentions that UIAspectRatioConstraint should always be parented to a GuiObject?

It confusingly isn’t documented on the UIAspectRatioConstraint page but seems to be documented on the UIGridLayout page instead.

https://developer.roblox.com/en-us/api-reference/class/UIGridLayout

It really should be listed on both pages though IMO.