TextObjects don't fully scale in ScrollingFrames when autoresizing

TextObjects ( TextLabel(s), TextBox(s), TextButton(s)) with AutomaticSize and TextWrap set to true should resize within a ScrollingFrame’s Canvas, if the TextObject’s text is too long, it should expand the Canvas when using AutomaticCanvasSize (X, Y, XY) but what happens instead is the TextObject ignoring the ScrollingFrame’s AutomaticCanvasSize property and instead resizing itself to the maximum view bounds of its parent, the viewbounds are affected by CanvasSize but for some strange reason it will adhere to staying within the viewbounds of the ScrollingFrame never letting AutomaticCanvasSize set the actual size required, happens even when the TextObject is parented to another UIObject with AutomaticSize set to Y, X or XY it will stop resizing based on all ancestors, including the Viewport bounds

Date time when it started happening : 20:10 UTC, 28th June

Video to help demonstrate what is happening

Reproduction steps:
Create a ScrollingFrame within a ScreenGui
The ScrollingFrame must have its CanvasSize Scale and Offset set to 0
The ScrollingFrame must have its AutomaticCanvasSize set to Y
Create a TextLabel Instance within the ScreenGui, set its AutomaticSize to Y
The TextLabel must have TextWrapped set to true
The TextLabel must have a large string or a large paragraph or multiple paragraphs within it
The TextLabel should size accordingly along the Y axis based on the length of the Text contents
Move the TextLabel or set its parent to the ScrollingFrame, you will instantly notice that instead of changing the ScrollingFrame’s CanvasSize it will just resize to the Viewbounds of the ScrollingFrame

A Place with the example of all the instances needed to reproduce this is made, all that is needed to test out the bug is to place the TextLabel into the ScreenGui’s ScrollingFrame and then back into the ScreenGui to see the valid TextLabel Y size

ScrollingGui AutomaticCanvasSize property bug with AutomaticSize TextObjects for example.rbxl (41.0 KB)

4 Likes

Thank you for reporting this. I filed a ticket to our internal database and the team will take a closer look at this.

2 Likes

Just want to quickly bump that this is still an ongoing issue. There currently isn’t really an easy way to make a textlabel scale to all of its contents in a scrolling frame without some hacky code.

Here’s some quick throwaway hacky code that’s involved:

local TextService = game:GetService("TextService")
local function getTextBounds()
	local message = game.Selection:Get()[1].Text
	return TextService:GetTextSize(message, 24, "Gotham", Vector2.new(game.Selection:Get()[1].Parent.AbsoluteSize.X, 1000000000))
end
print(getTextBounds() + Vector2.new(0, 48))

(Note, math.inf doesn’t seem to work properly for GetTextSize, so an absurdly large number is needed instead)

Hi @aaron_mccoy

Our engineers are working on this issue and giving updates here:

We are closing this thread since it’s a duplicate of the above one!

Thank you!

1 Like