Sizebox size calculation issue

I’m building dialog bubbles for my project and I’m using a size box as part of the widget layout. I want it to have a minimum and maximum width/height, so a sizebox sounds perfect for the Job. The dialog has multiple nodes, so on each node I update the text content inside the bubble and I want the sizebox to resize depending on the length of the text.

When I go from a node with more text to a node with less text, it works perfectly and reduces the size box width as expected

But when I go from a node with less text to a node with more text, something is preventing the sizebox from becoming wider and it keeps the same width throughout the whole dialog

Technically, that’s not wrong as the sizebox still respect my constraints, but I’d like it to let the text grow as much as possible like in the example above. I’ve tried multiple things, including a force layout prepass, but I can’t get it right. Does anybody know why this is happening?

After spending hours debugging Slate code, I found out the problem is not the size box, but the TextBlock widget. After it renders, it seems to cache the wrapping width or something along those lines, and after rendering the small dialog bubble, it’s keeping that wrapping width for the next one. Is there a way for me to invalidate that cache?

I was checking the C++ code but everything is private in the TextLayout classes.