UI elements aren't updating correctly when resized while Visible is false

Reproduction Steps
This issue is pretty critical, since it will break a lot of UI, especially UI based on frameworks such as Roact/Pract, in which you can’t define the order in which properties are set.

On macOS Montery 12.0.1, if you resize a frame while Visible is set to false and then set Visible to true, its children will not render correctly until it is resized again.

Here is a simple repro:
UIRenderRepro.rbxl (34.4 KB)

The center frame (pink) should always be sized relative to the parent, with an even 10 pixel border from the blue frame:

image

This repro contains a script which makes the parent frame invisible, resizes it to a random size, waits a second, and then makes it visible again for one second.

Expected Behavior
The pink frame should always have a correct size relative to the parent size
image

Actual Behavior
Instead, the pink size never updates its size if its parent size updated while it was invisible
image

Workaround
You can work around this issue if you always set a frame to be visible before you resize it. Unfortunately, I use a declarative UI engine (Pract) which does not let you define the order in which properties are set, causing a race condition where this bug only happens half the time.

Issue Area: Engine
Issue Type: Display
Impact: Very High
Frequency: Constantly
Date First Experienced: 2021-12-04 00:12:00 (-07:00)
Date Last Experienced: 2021-12-04 00:12:00 (-07:00)

5 Likes

Hello! Thanks for the bug report. I have submitted an internal ticket. I will update the thread once new information will arrive. Have a nice day!

2 Likes

Hi @DataBrain , this issue was fixed recently, but the update has not been rolled out yet. Could you please try turning on the flag: UpdateAutomaticSizeWhenSetVisible6(FILE > Advanced > Open Flag Editor > Search ‘UpdateAutomaticSizeWhenSetVisible6’ in Overrides tab and change the value to true, and you may need to restart the studio) and see if this fixes this issue? Thank you!

1 Like


I don’t see any flag editor, and I’m on mac, so I can’t use MaximumADHD’s modded studio.

Oh ok, so I just tried your repro file with this flag set, and the issue was resolved. We will roll out this fix hopefully in our next few releases. Thank you!

2 Likes

Hi @DataBrain , the fix was turned on recently, please update your studio and verify if this fixed your issue. Thank you!

4 Likes

The repro seems to work fine now!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.