Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Input Field behaviour on iOS

Discussion in 'iOS and tvOS' started by Matt_at_mindtrigger, Aug 10, 2017.

  1. Matt_at_mindtrigger

    Matt_at_mindtrigger

    Joined:
    Jan 20, 2014
    Posts:
    60
    Hi,

    I noticed that in the editor an input field that has been used before (and therefore has some text in it) when clicked on again will automatically select all that text. I can then either start writing something or press backspace and the prior text will simply clear or be replaced... or I can click on the field again (right of the pre-existing text) and deselect the pre-existing text and continue to add characters to it. This is the desired behaviour!

    However in my iOS build when clicking the input field it does NOT select the pre-existing text but rather ALWAYS puts the caret to the right of the pre-existing text. So it heads right to the behaviour I would expect when clicking twice.

    This is NOT desired behaviour for me because I use the input field for a search mask and it will be used very often during runtime. So it would be quite tedious having to clear the field by using backspace on every single pre-existing character every time.

    So my question is:
    Why does it behave differently than it does in the editor? Is this normal?
    Is there an easy way to fix this, some checkbox I forgot to check or something?
    (I am using Unity 5.5.2 btw)
     
    booferei likes this.
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Are you using the input field from UnityEngine.UI or the one from GUI class?
     
  3. Matt_at_mindtrigger

    Matt_at_mindtrigger

    Joined:
    Jan 20, 2014
    Posts:
    60
    Uhm good question... UnityEngine.UI I believe... I'm using the one you create straight from the GameObject -> UI -> Input Field tab.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Yes, that is UnityEngine.UI.
    Have you selected to hide touch screen keyboard input field for this field of yours or not?
     
  5. Matt_at_mindtrigger

    Matt_at_mindtrigger

    Joined:
    Jan 20, 2014
    Posts:
    60
    You mean the checkbox "Hide Mobile Input"?
    Yes I have checked that to hide the additional input-field from the keyboard itself.
     
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Yeah, I mean try with or without that. I couldn't find anything better for that I'm afraid.