View automatically grow or shrink based on its content

I would like to make a view adjust it's height automatically based on the content. I configured a view as a flex column container. Suppose I place two labels on top of each other. I would like the view to adjust its height to display only these two labels. If I set the Display property of one of the labels to false I would expect the view to shrink to the size of the remaining label. If I set back the Display property to true, I woud expect te view to grow in order to show the two labels. Is it possible?

I think you can set the view's height to auto. Note that if you resize the view in the designer manually, it will overwrite the height back to a number value

Useful CSS Stuff - Ignition - Inductive Automation Forum

1 Like

Setting the height to auto raises an error: defaultSize.height: string found, integer expected

I know, but it still works, at least for popups.

Indeed it works! Thanks for the tip!

1 Like

It also works if the view is used as a template in an embedded view, which was the purpose of the question at first!

When it's embedded in a column flex you can just define the basis as auto to set the height based on its content. This works for any component within a flex