Search Unity

Official Placeholder support

Discussion in 'UI Toolkit' started by HugoBD-Unity, Oct 24, 2022.

  1. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    497
    Welcome to the discussion thread around the built-in Placeholder feature. As of 2023.1, placeholder is supported for TextFields and ValueTypeFields. In this thread, you’ll find examples of how to use the Placeholder, it’s also a good place to ask for help and share feedback.

    The clip below shows how to use the Placeholder property and override the default styles through the UI Builder.
    placeholder.gif

    The same can be achieved programmatically using the following APIs:

    Code (CSharp):
    1.  
    2. TextField.textEdition.placeholder
    3. TextField.textEdition.hidePlaceholderOnFocus
    4.  


    The USS classname when the placeholder is visible is:

    Code (USS):
    1. .unity-base-text-field__input--placeholder
     
    Last edited: Oct 24, 2022
    kmowers, kayy, Mj-Kkaya and 6 others like this.
  2. TeorikDeli

    TeorikDeli

    Joined:
    Apr 6, 2014
    Posts:
    148
    Nicee! Will this be backported to 2021.3 or 2022.x?
     
    oyenw likes this.
  3. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    497
    We are reluctant to backport features to ensure stability on earlier releases. So, unfortunately, there are currently no plans to backport.
     
  4. emredagwodo

    emredagwodo

    Joined:
    Oct 12, 2023
    Posts:
    1
    Great news! But we are using version 2022.3.x, it would be great if you could bring a retroactive update.
     
  5. RageAgainstThePixel

    RageAgainstThePixel

    Joined:
    Mar 11, 2020
    Posts:
    66
    sounds like the lazy answer. I pay too much for a license at it is, on top of the upcharges for all the services I didn't ask for.

    It would be great to get a little backport for a feature that should have been included in the initial release.
     
    Skibitsky likes this.