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

InputField bugs

Discussion in 'UGUI & TextMesh Pro' started by giano574, Apr 14, 2015.

  1. KarlShifflett

    KarlShifflett

    Joined:
    Feb 27, 2015
    Posts:
    38
    The answer to your question is very complex. It took me days to finally figure this all out. It would take a very large blog post to explain this to someone who has never done this. Currently I'm working 16-18 hours days so my time is very limited and I'm going on vacation next week.

    Everything you need is here, you just have to dig around.

    https://bitbucket.org/ddreaper/unity-ui-extensions/src/3456cfee9b55?at=default

    I also spent much time fixing bugs in the current InputField. I really needs a lot of work.

    Karl
     
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Maybe this is the fix for similar issue:

    673152) - UI: Fixed value of InputField.text when another field is being edited.

    4.6.6p3 version
     
    Malkyne likes this.
  3. giano574

    giano574

    Joined:
    Nov 28, 2013
    Posts:
    76
    Thank you.

    That is the exact same problem. I assume it will be in the next patch release for Unity 5. Thank you.
     
  4. Malkyne

    Malkyne

    Joined:
    Nov 18, 2009
    Posts:
    39
    Great find, MrEsquire! That sure does look like our bug. Let's hope that fix makes it into 5.1.2, too.
     
  5. AdamMoo

    AdamMoo

    Joined:
    Mar 11, 2013
    Posts:
    9
    Just saw the patch notes for 5.1.1p1 and it dosen't seem in yet :(
     
  6. IvanUroz

    IvanUroz

    Joined:
    Mar 17, 2015
    Posts:
    1
    @Malkine "Be sure that whatever namespace you give it is accessible from your version of InputField."

    How do I know wich namespace to write? Sorry if it's an ovbious question but I'm trying to figure it out and I cannot. Thank you very much for your contribution on this matter :)

    Nevermind, I already fixed it. I included "using UnityEngine.UI". It Works! Thank you very much!!
     
    Last edited: Jun 29, 2015
    Malkyne likes this.
  7. AdamMoo

    AdamMoo

    Joined:
    Mar 11, 2013
    Posts:
    9
    5.1.2p1 and I still can't seem to find it in the change logs... maybe they missed it out ?
     
  8. Malkyne

    Malkyne

    Joined:
    Nov 18, 2009
    Posts:
    39
    @AdamMoo -- I would retest, if you can. I had to temporarily backburner the app I was working on, but the last time I looked at it, my stock InputFields seemed to be working in the latest build. I would love to see if anyone else can verify that.
     
  9. DurbsDev

    DurbsDev

    Joined:
    Sep 16, 2012
    Posts:
    16
    I just tried 5.1.2f1 and 5.1.2p1 and the input field capture being duplicated into previous input fields on the same panel is still sometimes happening...

    It seems to be more prevalent on Samsung S4 for some reason. It could be duplicated on 3 of these devices with little effort.

    I have reported as a bug to Unity.
    http://fogbugz.unity3d.com/default.asp?714368_n1hq83ispe79mi70

    Please log as bugs too so this can get proper traction. I could not see a place to Vote on fogbugz?

    673152 mentioned earlier seems to be closed of as a fix to 4.x - no mention of 5.x. Also this is for iOS where I an only experiencing the issue on Android and iOS is now fine.
     
  10. KarlShifflett

    KarlShifflett

    Joined:
    Feb 27, 2015
    Posts:
    38
    I'm still using my custom Inputfield for our projects. Just too many issues with the one Unity ships. This InputField needs a lot of love, but is not getting any.
     
  11. Wulven1

    Wulven1

    Joined:
    Oct 7, 2014
    Posts:
    6
    MrEsquire likes this.
  12. KarlShifflett

    KarlShifflett

    Joined:
    Feb 27, 2015
    Posts:
    38
    What unity really needs to do, is create a project that has a data entry form with 10 fields with an outstanding user experience and then post that project.

    Unless unity does this, they will never understand what developers go through using their product that needs a lot of work to make this work. End result on Android is not nearly has good as IOS.

    Yea, seems simple, right. Not.

    Unity please do this.

    Karl
     
  13. Wulven1

    Wulven1

    Joined:
    Oct 7, 2014
    Posts:
    6
    Unity replied to the pull request and said that they accepted the two changes to fix the InputField bugs! Progress!

    I also have a work-around for the input caret that is off of where it should be with some fonts. I traced it down to the UICharInfo.cursorPos that is just plain wrong, but without source code for the text renderer, I can't fix it. Must be something to do with the font metrics... If you're using a different font other than Arial and your caret is way off the text, you can see https://bitbucket.org/Wulven/ui/commits/6a5c1e65ad1a4db7d461a24037855fdea11c63fe for a workaround that lets you manually fix the caret adjustment on each InputField.
     
    DurbsDev and MrEsquire like this.
  14. AdamMoo

    AdamMoo

    Joined:
    Mar 11, 2013
    Posts:
    9
    5.1.3 just released, only 2 UI fixes and no input field fixes.
    Any one have any idea how long from the pull request till it gets merged ?
     
  15. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Changes from PR's will go into the next major version. In this case i think it got into 5.2. In general we dont comment on how long it takes for us to evaluate a PR before it gets merged (if it gets merged at all).
     
  16. Malkyne

    Malkyne

    Joined:
    Nov 18, 2009
    Posts:
    39
    Thank you for chiming in, Phil! It's good to know that someone is listening, at least.
     
  17. KeskilVladimirov

    KeskilVladimirov

    Joined:
    Apr 17, 2015
    Posts:
    1
    If you add different fonts, each InputFild, then the problem will be solved. For me it is a solution, Sorry for my english :)
     
    Last edited: Sep 8, 2015
  18. _muffin

    _muffin

    Joined:
    Feb 24, 2015
    Posts:
    7
    Hi guys,

    I have a much simpler problem. I have an Input Field with character limit set to 256 and when i deploy to mobile (iOS/Android) it stops taking in characters way before the character limit. Is there something Im missing? Is the text size capped to the size of the input field?

    Thanks in advance guys.
     
  19. Malkyne

    Malkyne

    Joined:
    Nov 18, 2009
    Posts:
    39
    Hi, muffin!

    I suspect that you're more likely to get help for this question if you start a new thread with a subject that directly addresses your problem. This thread is really about two very specific InputField bugs, and I think it's going to get very confusing if we mix in a discussion about an unrelated InputField issue.
     
  20. DurbsDev

    DurbsDev

    Joined:
    Sep 16, 2012
    Posts:
    16
    Finally there is a fix in 5.2.1p1!

    From the release notes :

    (none) - UI: Fix for multiple InputFields in a scene having a text being input in one field incorrectly changing the display of other fields while the keyboard is open.

    @Malkyne and Wulven1: Thanks for your contribution to getting this sorted. I really appreciate what you have done for the com-Unity!

    I'm busy downloading the patch release now.
     
    polytropoi and Malkyne like this.
  21. _muffin

    _muffin

    Joined:
    Feb 24, 2015
    Posts:
    7
    Regarding my post. Apologies. I was looking at the wrong prefab...

    Regards,
    Andrei
     
  22. Ox_

    Ox_

    Joined:
    Jun 9, 2013
    Posts:
    93
    Is it possible to remove placeholder text on selection?

    Now it's removed only when users start typing but that's confusing.
     
  23. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    You'd have to do that yourself atm.
     
  24. Ox_

    Ox_

    Joined:
    Jun 9, 2013
    Posts:
    93
    Yes, forgot to post it. :)

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.UI;
    3. using UnityEngine.Events;
    4. using UnityEngine.EventSystems;
    5. using System.Collections;
    6.  
    7. [RequireComponent(typeof(InputField))]
    8. public class InputFieldHidingPlaceholder : MonoBehaviour, IPointerClickHandler
    9. {
    10.     InputField _field;
    11.     InputField Field {
    12.         get {
    13.             if (_field == null)
    14.                 _field = GetComponent<InputField>();
    15.             return _field;
    16.         }
    17.     }
    18.  
    19.     void OnEnable()
    20.     {
    21.         Field.onEndEdit.AddListener(OnEditingEnded);
    22.     }
    23.  
    24.     void OnDisable()
    25.     {
    26.         Field.onEndEdit.RemoveListener(OnEditingEnded);
    27.     }
    28.  
    29.     void OnEditingEnded(string value)
    30.     {
    31.         Field.placeholder.gameObject.SetActive(true);
    32.     }
    33.  
    34.     public void OnPointerClick(PointerEventData eventData)
    35.     {
    36.         Field.placeholder.gameObject.SetActive(false);
    37.     }
    38. }
     
  25. fcloss

    fcloss

    Joined:
    Dec 1, 2011
    Posts:
    192

    Hi! I am having this same issue on 5.3.5f1. Do you know if the bug is still alive or back to life? =(
     
  26. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Im wondering if there is a bug in 5.4.0b24

    I have two UI panels, each has a InputField, I type text into one input field, everything fine, then when i try to type into the other input field it seems it cant get the focus, everything i type always goes to the first input field, no matter how much i click on the other input field it doesnt accept any text.

    Anybody seen this?