ContentSizeFitter - Forcing minimum size?

I’m developing a simple tooltip component. The structure is as follows…

  • Panel - Image, ContentSizeFitter, HorizontalLayoutGroup

  • TMP Text

Here are the panel settings…

The panel properly resizes horizontally as the text length increases.

The problem I’m having is that the ContentSizeFitter appears to be forcing the panel’s initial width to 128 pixels. The panel does get wider when the text is greater than 128 pixels, but it doesn’t scale down to fit shorter text.

When I set “Horizontal Fit” to “Unconstrained”, set the width to 30, and then set “Horizontal Fit” to “Preferred Size” again the panel size is set back to 128.

I need the panel size to be smaller initially. Any suggestions?

Did you ever figure this out? Having the exact same problem.

No. I’m just living with it for now. Annoying little problem.

You need to put a Content Size Fitter on the TMP Text object as well.