Search Unity

Bug InputField on Android swallows up the first letter after clearing the inputfield

Discussion in 'UGUI & TextMesh Pro' started by christianstrang, Sep 16, 2022.

  1. christianstrang

    christianstrang

    Joined:
    Aug 6, 2013
    Posts:
    29
    I'm running into the issue, that when I clear the content of an inputfield (e.g. after the user inserts a SPACE), the first letter afterwards will be swallowed if I type fast enough (<300ms). This can be easily reproduced by this code:

    Code (CSharp):
    1. public TMP_InputField inputField;
    2.  
    3. void Update()
    4.     {
    5.         if (inputField.text.Contains(" "))
    6.         {
    7.             inputField.text = "";
    8.         }
    9.     }
    This only happens on Android, it works fine in the editor (might be an android architectural issue?)
     
    Last edited: Sep 16, 2022