AutomaticSize not updating when object is set to be visible

I’ve been having this issue for months, and I have just seen this forum post. When is this going to be fixed? It’s still affecting many games including mine.

4 Likes

Please provide us with an update. This is supposed to be a live, fully-functioning feature—it’s been broken for months (if you dare set your guis Visible property…)

3 Likes

I’m also still experiencing this issue with AutomaticSize.

1 Like

It appears to work just fine when you use pixels, just not with scale.
It would be nice to have it so the scale was consistent with the size of the actual viewable frame when it expanded, and for it to work with scale, as right now with scale, even if you use tricks to make the elements the same height when the canvas gets bigger, it still runs the elements off the canvas then eventually they resize.
Hopefully this will be fixed soon.

Why is this still not fixed? Any updates @CharlieGordonnn?

This is still a major issue for me. I created this hacky fix to temporarily solve the issue while only slightly affecting the most observant users. The hack works by increasing the size by 1 pixel for 2 frames, every time that the object becomes visible.

This code is modified based on @RemoDunks hack in this thread for another similar issue.

local rs = game:GetService("RunService")
local function FixSizingBug(inst)
    if inst:IsA("GuiObject") then
        local function OnVisibilityChanged()
            if inst.Visible then
                -- use UISizeConstraint to not mess with any tweens
                local resizer = Instance.new("UISizeConstraint")
                resizer.MaxSize = Vector2.new(math.ceil(inst.AbsoluteSize.X) + 1, math.ceil(inst.AbsoluteSize.Y) + 1)
                resizer.MinSize = resizer.MaxSize
                resizer.Parent = inst

                -- for some reason it takes 2 frames to take effect
                rs.RenderStepped:Wait()
                rs.RenderStepped:Wait()

                resizer:Destroy()
            end
        end

        inst:GetPropertyChangedSignal("Visible"):Connect(OnVisibilityChanged)
    end
end

local function FixGui(gui)
    if gui:IsA("ScreenGui") then -- feel free to listen in workspace for SurfaceGui and BillboardGui
        gui.DescendantAdded:Connect(FixSizingBug)
        for i, v in pairs(gui:GetDescendants()) do
            FixSizingBug(v)
        end
    end
end

game.Players.LocalPlayer:WaitForChild("PlayerGui").ChildAdded:Connect(FixGui)
for i,v in pairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
    FixGui(v)
end

Hi @royee354 , thanks for following-up on this. We have been actively looking into this issue. But the change has also been causing a series of regressions since it touches some basic functions. We are now trying to finalize the fix in a few weeks. Sorry about the delay and we appreciate your patience!

7 Likes

As of 2021-09-16T16:22:37Z, the FFlag UpdateAutomaticSizeWhenSetVisible5 was set to True, which seems to have fixed the bug.

This basic demonstration shows that disabling/enabling the visibility changes the size of the parent container:

3 Likes

Our currency labels use AutomaticSize and have broken today. Readjusting the window snaps them back into the correct size.

1 Like


same issue, labels are being crunched down because of this

I know its an old thread but I just fixed this with this script in the frame:

local frame = script.Parent.List

local layout = frame:FindFirstChildWhichIsA(“UIGridStyleLayout”)

local absoluteContentSize = layout.AbsoluteContentSize

frame.CanvasSize = UDim2.new(0, 0, 0, absoluteContentSize.Y)

layout:GetPropertyChangedSignal(“AbsoluteContentSize”):Connect(function()

local absoluteContentSize = layout.AbsoluteContentSize

frame.CanvasSize = UDim2.new(0, 0, 0, absoluteContentSize.Y)

end)

Unfortunately it’s still not fixed in my game.

Could we get an update on this? The issue is still not fixed.

Hi @unmiss and folks in this thread, please refer to this post and leave any feedbacks you may have!

I’m not able to access that post. It says it’s private.

I have moved the post to the Roblox Surveys section, please try again and see if you can access it.

Sorry to say, but this issue is still there, this is a great headache as making a manual auto resize for every scrolling frame is a joke. And I am still facing this issue, and I request you to look around on this.

Thank you.

1 Like

Something like this would work:

local function automaticCanvasSize(scroller)
    local padding = scroller:FindFirstChildOfClass("UIPadding") or Instance.new("UIPadding")
    local layout = scroller:FindFirstChildOfClass("UIListLayout") or scroller:FindFirstChildOfClass("UIGridLayout")
    
    local function update()
        local y = layout.AbsoluteContentSize.Y
        scroller.CanvasSize = UDim2.fromOffset(0,y + padding.PaddingTop.Offset + padding.PaddingBottom.Offset)
    end
    
    update()
    layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(update)
end

automaticCanvasSize(script.Parent.Scroller)
1 Like

Friendly reminder for Roblox to fix this. Its been an issue for me in multiple games and manually resizing using scripts souldn’t be required.

Hi @Ejioplex , this issue is on our bugfixing list and we’ll be looking into it shortly. Thank you for your understanding and patience!

3 Likes