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
  4. Dismiss Notice

InpitField with no TextViewport

Discussion in 'UGUI & TextMesh Pro' started by sergey-popov, Nov 4, 2020.

  1. sergey-popov

    sergey-popov

    Joined:
    Oct 20, 2015
    Posts:
    2
    Hello,

    Could you please add null checks for TextViewport?

    I have input field with dynamic height - so I don't need any mask for input field and scrolling logic (OnScroll, OnPageUp, OnPageDown etc)
    Would be great if you add some null checks for text viewport just like non-required vertical scrollbar.
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    I am not sure how the Input Field will behave without a viewport especially with Layout components as this viewport is part of the input field structure.

    The RectMask2D can be disabled.
     
  3. sergey-popov

    sergey-popov

    Joined:
    Oct 20, 2015
    Posts:
    2
    Well it does work with VerticalLayout and ContentSizeFitter with preferred height and with no viewport at all:
    upload_2020-11-5_1-53-1.png

    In this case input field behaves not like scrollview but like expandable input field. Thats exactly what I need but causes null reference exceptions and unnecessary scroll logic.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    You should be able to achieve the same results with these layout components placed on the parent input field while keeping the child object structure intact.

    Are you observing issues if you keep the viewport in place with those layout components on the parent input field?