Strange Scrolling Frame, CanvasSize

I encountered a strange “ScrollingFrame” optimization.
In short, “UIListLayout” is very strange.

UIListLayout settings

image

My code

local scrollingFrame = ScrollUi
				local UIListLayout = scrollingFrame.UIListLayout

				scrollingFrame.CanvasSize = UDim2.new(0, UIListLayout.AbsoluteContentSize.Y, UIListLayout.AbsoluteContentSize.X ) -- This makes sure the scrolling frame is scaled when the game starts.

				local function onContentSizeChanged()
				print("Debug1")
					scrollingFrame.CanvasSize = UDim2.new(0, UIListLayout.AbsoluteContentSize.Y, UIListLayout.AbsoluteContentSize.X ) -- This makes sure the scrolling frame is scaled when ever there is something added into it during the game.
				end

				UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(onContentSizeChanged)

if someone can solve this problem that was very good

Don’t edit the size with a script - just enable AutomaticCanvasSize in the Properties menu.

From the very beginning I do this and the result is the same as in the video