Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

UIElements Foldout doen't seem to enforce its height when resized

Discussion in 'UI Toolkit' started by Dan-MacDonald, Feb 22, 2020.

  1. Dan-MacDonald

    Dan-MacDonald

    Joined:
    Oct 25, 2013
    Posts:
    17
    See attached animated .gif

    The UXML is pretty basic, nothing fancy


    <ui:Foldout text="Circle Settings" value="true">
    <ue:IntegerField name="maxCirclesValue" label="Max Tensor Fields" binding-path="MaxTensorFields"/>
    <ui:MinMaxSlider label="Radius Range" name="radiusSliderValue" low-limit="0" high-limit="0.5" binding-path="MinMaxCircleRadius"/>
    <ui:VisualElement class="module-row minmax" name="min-max-row">
    <ui:VisualElement name="spacer"/>
    <ui:Label label="Min" name="min" />
    <ui:Label label="Max" name="max" />
    </ui:VisualElement>
    </ui:Foldout>


    Relevant uss

    .minmax > Label {
    flex-grow: 1;
    opacity: 0.5;
    }

    .minmax > #max {
    -unity-text-align: upper-right;
    }
     

    Attached Files:

  2. stan-osipov

    stan-osipov

    Unity Technologies

    Joined:
    Feb 24, 2020
    Posts:
    31
    Hello, as the quick fix, you can add this to your uss:
    Code (csharp):
    1. .unity-foldout {
    2.     flex: 0 0 auto;
    3. }
     
    Dan-MacDonald likes this.
  3. Dan-MacDonald

    Dan-MacDonald

    Joined:
    Oct 25, 2013
    Posts:
    17
    Thank you!