Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice
  2. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

Help Wanted TextField value updated?

Discussion in 'UI Toolkit' started by ktest112233, Sep 18, 2020.

  1. ktest112233

    ktest112233

    Joined:
    Jan 7, 2019
    Posts:
    37
    Hi,

    Is there an event that is called as the user types?

    Code (CSharp):
    1.  
    2. textInput.RegisterCallback<ChangeEvent<string>>((e) => {});
    3. textInput.RegisterValueChangedCallback<string>((value) => Debug.Log(value));
    4.  
    the above 2 only work when the user presses enter. I want an event that is called when the value changes.

    Thanks!
     
    Last edited: Sep 18, 2020
  2. uMathieu

    uMathieu

    Unity Technologies

    Joined:
    Jun 6, 2017
    Posts:
    334
    The TextField has a isDelayed property. Setting it to false will give you the behaviour you need.
     
unityunity