Widget component's Toggle Visibility retains widget state of before it was updated!

So I update the widget while the widget component’s visibility is off (inventory widget in this case). You can see towards the end in the gif, the item gets removed from the inventory while the widget component is not visible.

But when I toggle the visibility back on, it shows the widget as it was before it was updated, for a frame or 2, before it switches to the updated look. It’s noticeable.

ah3zfj

Is there anything that can be done to prevent this? Thanks.

maybe you can force call the update. but i think you might need cpp for that.
or don’t reuse the widget.
or maybe use a material.

What do you mean?

How?

You’ll likely want to implement some manager / caching / buffer functionality that keeps track of all changes that have been that would update the widget in some visual way (when the widget is invisible); then when opening the widget → perform those updates first → if all cached operations have been completed and the widget is fully updated → make the widget visible.

Alternatively (or in combination with the above) make the widget instantly visible, but implement some kind of loading widget for each tile of which you know it needs to show an image, and swap it out with the actual content.

A simpler, but naive and less efficient approach would be to mark the widget component to Tick when Offscreen or hide the widget after a frame or 2 delay (to allow it to update before making it invisible)

1 Like

Thanks. Yeah, I can just collapse the whole widget itself, instead of toggling visibility on the widget component, in my case. That works.

But the bug still stands, so hopefully I won’t encounter some case down the line, where I need to hide the widget component instead.