Search Unity

Advanced Input Field

Discussion in 'Assets and Asset Store' started by fennecx_development, Jul 29, 2017.

  1. LuizBenetonScopely

    LuizBenetonScopely

    Joined:
    Jan 14, 2019
    Posts:
    7
  2. LuizBenetonScopely

    LuizBenetonScopely

    Joined:
    Jan 14, 2019
    Posts:
    7
    @jpienbro, is it possible to get the keyboard size before it opens?
     
  3. LuizBenetonScopely

    LuizBenetonScopely

    Joined:
    Jan 14, 2019
    Posts:
    7
    @jpienbro, I'm facing another problem with the plugin. On Android, it throws a null ref exception on the native level because it cannot find the native class: com.jeroenvanpienbroek.nativekeyboard.NativeKeyboard.
    After some digging around I noticed that the final Manifest constructed on a build didn't have any reference to NativeKeyboard.

    In our project, we have a particular way of constructing the Manifest, so it would be great if you could share with us what needs to be in the final manifest in order to enable NativeKeyboard :)

    Thanks!
     
  4. Bunderant

    Bunderant

    Joined:
    May 29, 2013
    Posts:
    21
    Thanks for making this plugin, it's really nice to have a way around so many of the input field headaches on mobile devices.

    I did find a bug, and have some other feedback for ya. The bug is in the SimulatorKeyboard's ShowKeyboard method when using custom validation. It should deserialize the CustomValidator JSON like this:

    Code (CSharp):
    1. CharacterValidator characterValidator = null;
    2.             if (!string.IsNullOrEmpty(characterValidatorJSON))
    3.             {
    4.                 characterValidator = ScriptableObject.CreateInstance<CharacterValidator>();
    5.                 JsonUtility.FromJsonOverwrite(characterValidatorJSON, characterValidator);
    6.             }
    7.             textValidator.Validator = characterValidator;
    The current implementation doesn't use CreateInstance and FromJsonOverwrite, so an error is thrown because Unity doesn't allow ScriptableObjects to be created at runtime any other way.

    As far as the other feedback, I'd recommend changing up the folder structure a little bit. Instead of Plugins/[everything else], make AdvancedInputField the parent folder, and put anything required in s Plugins (or Editor or [Whatever]) subfolder. Unity will still recognize the Plugins folder as it's supposed to. Then, the code from AdvancedInputField won't be spread throughout any existing project's folder structure.

    It'd be awesome to be able to subclass the CharacterValidator class. It looks like it's generating a native object from that class' JSON, though, right? Any custom functionality I'd added to that class was lost in builds, so I'm guessing that's the case. All I REALLY need personally is a line count limit, though, which I saw on the Trello board. Any word on when that might be ready, or a way I could implement it myself?

    Anyway, this is a really good asset, and thanks again for building it.

    EDIT: One more thing: It'd also be great to have a validation rule for consecutive characters, rather than just occurrence count. For instance, having more than one consecutive space can cause weird issues with the cursor going out of the editable area's bounds, so I like to replace any double-space with something that will trigger a word wrap.
     
    Last edited: Feb 28, 2019
  5. LuizBenetonScopely

    LuizBenetonScopely

    Joined:
    Jan 14, 2019
    Posts:
    7
    Ok, managed to fix it on my own. Our project had a Gradle template I was not aware of. :)
     
  6. seliverstovvladislavpb

    seliverstovvladislavpb

    Joined:
    Feb 1, 2019
    Posts:
    2
    Hi. I have a problem with input field. When i start typing on my android device in input field, after few characters(it can be any number) carret moves to middle of my text. Also, when I typing in one input, then chose another, start the input but nothing appears, if you press again and start entering the text, the previous text is become entered before the carriage.
    What the problem it can be?This bug does not always appear.
    PS this bug appear even in your demo scenes.
     
  7. johmaxgro

    johmaxgro

    Joined:
    Oct 3, 2018
    Posts:
    10
    Hi,

    When selecting text in the Input Field with Text Renderer TextMeshPro, Text gets selected (tested it by deleting the selection afterwards) but the selection is transparent (or not visible). When using Text as Renderer, it works fine . Selection is then visible through the selected color.
    Settings are default settings (I created the InputFields "InputField with Unity Text" and "InputField with TextMeshPro Text" normally).

    Is there anything which has to be set up on top to get the text selection (or the visualization of it) working for InputField with TextMeshPro?

    Thanks
     
  8. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    Hi, i've bought the asset on Asset Store.
    I've downloaded and imported it in a new blank project but when i create an Advanced Input Field it doesn't give me any error, but show me that the created "AdvancedInputField_Unity_Text" can't use and compile the script for some error.

    I've tried also the convertion tool but it didn't work... What i've to do?

    It's very urgent for my job!

    Thanks you
     

    Attached Files:

    Last edited: Mar 4, 2019
  9. jmansa

    jmansa

    Joined:
    Apr 13, 2012
    Posts:
    75
    That would be nice to :) But what i ment was, when selecting some of the text, is it possible to change the background color on the selected text? To see what text I have selected and want to copy.
     
  10. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Are you using Unity 2018.3.0, 2018.3.1 or 2018.3.2? Then please update to a newer version of 2018.3.*. Those versions seem to cause compiler errors atm.
     
  11. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    The background color of the selected text can be changed with the "Selection Color" property.
    upload_2019-3-5_15-0-54.png
     
  12. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Normally not, at least if you followed the instructions of how to activate TextMeshPro for this plugin, but since the text rendering and text editing works you probably configured it correctly.

    I ran a quick test in Unity 2018.3.6, created an InputField with TextMeshPro renderers from the dropdown and the text selection is visible for me.

    What version of Unity are you using?
    What version of TextMeshPro are you using?
     
  13. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Hmm...Yes, that is strange. Maybe there are some delayed native Android events that are getting executed, which would still be weird, because it happens when editing a single inputfield instance.
    Does it happen on multiple different Android devices or only on a particular device?
     
  14. johmaxgro

    johmaxgro

    Joined:
    Oct 3, 2018
    Posts:
    10
    Yep, I found the problem. Sorry for responding lately. It was due to a curved Canvas I use --> everything except the selection works in this case. But I went back to a flat Canvas anyway.
     
  15. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    1. Thanks for that bug report and fix ;)
    2. If you mean adding the main "AdvancedInputField" directory in the project root (Assets directory). I personally don't like that some plugins/third-party content is being installed there. I prefer to keep root directory small and simple, only with directories like "Scenes", "Scripts", "Textures",..
    3. Subclassing that class would be difficult, because the native binding for iOS and Android have their own native code for that, that will be executed as soon as a text change occurs natively. That json format tells the native binding what rules to apply.
    4. Added to the TODO list
     
  16. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Afaik the native API of Android & iOS don't have a way of getting this value without registering for events and waiting for it to get executed when the keyboard appears.
     
    LuizBenetonScopely likes this.
  17. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    It might be the native input field that handles all the keyboard input. Normally this gets rendered offscreen (because I couldn't get it to be completely invisible), but maybe your VR device forces this on screen.
     
  18. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    Hi, i'm using Unity 2018.2.21f1. I can't update to 2018.3 because my project will broke up.

    What can i do?
     
  19. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Unity 2018.2.21 should work normally. Only those Unity builds I mentioned should give issues.
    I've quickly tested this and didn't get any compiler errors:
    - Install Unity 2018.2.21
    - Create new project
    - Install AdvancedInputField package from AssetStore tab.
    - Open 1 of the sample scenes (I used "Form")
    - Press play in Unity Editor
    - Input seems to work normally.

    If this doesn't work in a clean project for you, maybe your Unity Editor has the wrong package in it's Cache. Maybe try clearing the AssetStore cache and redownloading.
     
  20. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    OK, now in a blank project it work but not in my main project. I haven't nothing strange. Seems like there is something that broke your script and give me the error.
     

    Attached Files:

  21. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    Ok, i've found the errors. I've checked here for the solution of my problem and the errors was cause by the absence of a whitespace between #if and (IF_STATEMENT) in your scripts.

    Hope this can help other and you can fix :)
     
  22. unity_XvY04alCp4iZgg

    unity_XvY04alCp4iZgg

    Joined:
    Oct 26, 2018
    Posts:
    4
  23. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    The behaviour you want can be achieved using a custom CharacterValidator. See the sample scene "CharacterValidator" and the documentation in the ReadMe how to configure them.
    If you look at the referenced CharacterValidator object ("ASCIILettersValidator") of the top inputfield in that sample scene , duplicate that object and change the amount of rules to 2 (that last rule isn't necessary for your case). Then just configure your AdvancedInputField like that ones in that sample scene to use your created CharacterValidator.
     
  24. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Thank you for reporting this.
    I'll make a new release of this plugin to fix this issue and several other small bugs.
     
  25. BennyTan

    BennyTan

    Joined:
    Jan 23, 2014
    Posts:
    141
    Currently to bring up the action bar, the user has to tap on the blue cursor/icon/marker thingy.
    Is it possible to make it such that if the player long presses anywhere on the input field the actionbar appear similar to other apps?
     
    Last edited: Mar 7, 2019
  26. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    Hi, i've a question: the autoscroll of the UI when keyboard rise up is automatic? Because in some situation it's automatic and work well, in others don't work at all. How can i assure it works always?
     
  27. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Currently not if the inputfield itself is not selected yet.
    That feature request is already on my TODO list: https://trello.com/b/0qda8XOp/advanced-input-field ("Feature: Enabling Hold to show ActionBar on not focused inputfield"). Another user requested it some time ago, so I'll just increase the priority on my TODO list for now.
     
  28. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    If you are using the KeyboardScroller component on the ScrollRect (like in the sample scene "Form"), make sure that the ScrollRect content is correctly configured (see the "Form" scene or the ReadMe of the plugin). The default behaviour of that KeyboardScroller is to only scroll if the keyboard will visually block the selected inputfield, but that behaviour can be changed on that KeyboardScroller component itself.
    Another option is to handle the Keyboard Height changes yourself by registering to the OnKeyboardHeightChanged event. "NativeKeyboardManager.AddKeyboardHeightChangedListener()". It will return the keyboard height in screen pixels when the keyboard appears and 0 when the keyboard has disappeared completely.
     
  29. gauravjain-zibtek

    gauravjain-zibtek

    Joined:
    Mar 12, 2019
    Posts:
    3
    Yes, it happened on multiple Android devices.
    Following are the few on which we found it:
    • Google Pixel XL
    • Samsung S9 Edge
    • Samsung S7 Edge
    • Samsung A6 plus
     
  30. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    I don't have any of those devices, but I can order one.
    Probably the Google Pixel XL, because I don't have a device of that manufacturer yet.

    Just some final questions before I start ordering that device:
    - First issue: After few characters the caret moves to the middle.
    Is this the middle of the text (current visible text) or the inputfield itself (bounds)?
    Does it only happen on the first inputfield the user selects or does it happen later with other inputfields too?

    - Second issue: Text copy of previous inputfield when switching between inputfields.
    For both issues: Are you using the default stock Android keyboard on those devices?
     
  31. gauravjain-zibtek

    gauravjain-zibtek

    Joined:
    Mar 12, 2019
    Posts:
    3
    Answers to your queries:
    1. After few characters the caret moves to the middle.
    => We haven't had this issue.

    2. Text copy of previous inputfield when switching between inputfields.
    => This seems to be a wrong problem statement for the issue which we are having.
    Suppose there are 3 input field on a page:
    * Email
    * Password
    * ConfirmPassword

    User fills the Email field then selects 2nd field, Password (either by touch or by return key of keyboard)
    At that moment caret is not shown on that field and keyboard still stays open.
    So, user types some character using the keyboard.
    After that, when a user clicks on next inputfield, ConfirmPassword. All the character user typed on keyboard gets entered in the ConfirmPassword field which were suppose to go into the Password field.

    One thing that we also observed that.
    Suppose following data is already present in the following fields:
    * Email: John.Doe@email.com
    * Password: Doe
    * ConfirmPassword: Jane

    User updates the Email field then selects 2nd field, Password.
    Same thing happens keyboard stays open but input field is not in focus and caret is not active on that field.
    User types, let say "Dawn" and then clicks on next input field, ConfirmPassword.
    Then ConfirmPassword field automatically updates to "DawnDoe" value.
    Caret on the ConfirmPassword field is in the middle of "Dawn" and "Doe", "Dawn(caret)Doe".

    Note: Here we showed that error only took place on 2nd input field, but it's not like that.
    But we only observed the issue when a user select "Password" type field, we are still trying to reproduce it on standard type field as well.
    So, when a user either selects Password or ConfirmPassword field at that moment the respective inputfield does not get the focus and keyboard stays open.

    We used the default keyboard of those devices:
    Samsung devices: Samsung Keyboard
    Google Pixel: Gboard
     
    Last edited: Mar 13, 2019
  32. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Thanks for explaining the issues in more detail and the steps to reproduce.
    I'll look into it ;)
     
  33. sonnyboy

    sonnyboy

    Joined:
    Oct 25, 2015
    Posts:
    10
    Hi,
    I have used the plugin for a chat with textmeshpro and it works better than Unity built-in solution for simple use. However with the built-in input field I had to change some plugin code to make it work for me but the code is not modular. Also the documentation for functions is not present and I had to learn all from comments on the code. Which I want is call keyboard by code and listen events of value changes, begin, end events and keyboard height only and I would like to do the rest myself. Is this achievable without using AdvancedInputField component that I have missed to find out?
    Thanks
     
  34. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    If you want to handle all the event callbacks from the native keyboard yourself, you could look at the "MobileTextInputHandler" class. In particular the "Process" method. The "NativeKeyboardManager" class might be useful too, since it's the global manager class for the native keyboards of Android, iOS & UWP.

    But maybe you could get the behaviour you want without modifying the plugin/writing custom inputfield code. What behaviour are you trying to achieve?
     
  35. unity_XvY04alCp4iZgg

    unity_XvY04alCp4iZgg

    Joined:
    Oct 26, 2018
    Posts:
    4
    Hi,

    Based on the value from a drop down I am trying to set the Character Limit of a AIF dynamically. But it is not getting set. I don't know why.

    Code:

    Code (CSharp):
    1. public void OnCountryNameChanged() {
    2.             int limit = CountryNameText.text == "INDIA"
    3.                 ? 10
    4.                 : 15;
    5.             StartCoroutine(SetLimit(limit));
    6.         }
    7.  
    8.         IEnumerator SetLimit(int limit) {
    9.             yield return new WaitForEndOfFrame();
    10.             MobileNumberInput.ApplyCharacterLimit(limit);
    11.         }
    I debugged the code and all values are coming correct. But still the limit is not getting applied.
     
  36. Vasilis-Mbakalis

    Vasilis-Mbakalis

    Joined:
    May 23, 2017
    Posts:
    16
    Hello, i want to have english and german translations for my action bar buttons. User can change app's language through a button press, inside the app.Is there any way so i can update the "cut","copy","paste" and "select all" translation depending the button press using the LocalizationData?
     
  37. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    That ApplyCharacterLimit() method shouldn't be used. It's an Editor method I couldn't mark as internal, otherwise it wouldn't compile. I'll update this in the summary.
    Normally: "AdvancedInputField.CharacterLimit = limit" should work,
    I did find a bug that it doesn't update the character limit immediately on mobile if the inputfield is already selected.
     
    Last edited: Mar 18, 2019
  38. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Hmm, since the ActionBar isn't immediately created on start, I think the easiest way would be to create a custom ActionBarLocalizer script.
    1. Just copy everything from the ActionBarLocalizer script into your custom script.
    2. Change the name of the class
    3. Change the FindLocalization() method to read a language value from PlayerPrefs (that represents selected system language)
    4. Replace the ActionBarLocalizer on the ActionBar prefabs with your custom one
    5. In your button click callback set the language value in PlayerPrefs.
     
  39. unity_XvY04alCp4iZgg

    unity_XvY04alCp4iZgg

    Joined:
    Oct 26, 2018
    Posts:
    4
    `AdvancedInputField.CharacterLimit = limit` will not work since it is a readonly field.
    Error: `AdvancedInputFieldPlugin.AdvancedInputField.CharacterLimit' cannot be assigned to (it is read-only)`
     
  40. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    I should have been more clear. You should replace that AdvancedInputField part with the name of your instance.
    So in your case: "MobileNumberInput.CharacterLimit = limit;"
    This should work in latest version of the plugin.
     
  41. unity_XvY04alCp4iZgg

    unity_XvY04alCp4iZgg

    Joined:
    Oct 26, 2018
    Posts:
    4
    Oh God! I used it like this only ("MobileNumberInput.CharacterLimit = limit;"). I just copied from your answer. :D

    I am using an older version of the pluggin. That might be the issue. Thanks.
     
  42. BjoUnity3d

    BjoUnity3d

    Joined:
    Jul 24, 2012
    Posts:
    60
    Per this post, I've been trying to implement a simple state validation for months now. https://forum.unity.com/threads/advanced-input-field.485697/page-8#post-3698635 I ran into bugs that caused AIP to throw index out of range errors and they have since been fixed (Thank you!) in recent versions of the plugin. However, I am still not able to get this working on Android. I'm just using OnValueChanged to check each character as it's entered and 1) set to uppercase 2) validate the letter entered against a list of states/provinces. If it's invalid I set the value of the input (input.Text) to an empty string. Or if it's the second digit then a substring containing only the first digit.

    This all works fine on desktop. Then I publish to Android and after I enter the first digit (which is valid and set to uppercase) I go to enter the second digit, only I can't because it's now entering text BEFORE the first digit, as if I placed the cursor back at the start. And I can't backspace either. So I just get stuck with one digit in the field. So it looks like the caret position is not updating properly after I set the value of the text field. Is there some way to fix that?

    FYI this works fine with the Unity native input. I just don't like the extra text window that they show so I would prefer to use Advanced Input. Thanks!

    P.S. The cursor flashes in the correct position - at the end of the text, but when I type I can see the letter flashing in the first position, so there is misalignment between the cursor position and where the text is actually entered.

    SOLVED: After the line that sets the value of the text [inputField.SetText(value,false)] I added the line [inputField.SetCaretToTextEnd()]. This fixed the problem on Android. But I think there is still a bug - per above without adding that extra line the text entry position and flashing cursor position are misaligned.
     
    Last edited: Mar 20, 2019
  43. Jochanan

    Jochanan

    Joined:
    Nov 9, 2016
    Posts:
    85
    Does this component support default NEXT key on android phone?

    My phone shows return. When i press it, it focuses on next item:
    Screenshot_2019-03-20-15-02-46-619_com.test.test.png
    When i am in the web browser form, my keyboard has the "next" key available:
    Screenshot_2019-03-20-15-08-41-988_com.duckduckgo.mobile.android.png
     
  44. james_2ngaming

    james_2ngaming

    Joined:
    Sep 4, 2018
    Posts:
    1
    Hi, we purchased the asset recently (btw, great asset - we tried various others from open-source and commercial offers and this is the only one that hit the mark)..

    We've been testing it on a few mobile phones and it works correctly; except for the "Huawei p8 lite".

    On this phone when you access a field that would be behind the keyboard, it will push the content up correctly (as expected). However when you start to type something that could be autocompleted (i.e. not numbers) the suggestions / autocomplete appears (as it should) but the unity content falls back down (as if the keyboard wasn't open)

    Is this something that's been observed before?
    Ideally we would like to remove suggestions; can this be done?

    We do use a custom version of your "KeyboardScroller" component; however the only change is that we modify the canvas vertical position instead of using the scroll rect (due to the internal make-up of our application, we can't use a scroll rect).

    Thanks,

    James
     
  45. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    I couldn't reproduce that visual bug in latest version of the plugin on Android. I made a simple test scene that changes the text to a 4 letter word when the length is 5 in OnValueChanged and the cursor seems to correctly jump back to the end of the 4 letter word and I can continue entering characters from that position. (Only used SetText())
    Are you maybe using an older version of the plugin?
     
  46. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Currently it's not implemented on Android that that key changes based on if you have a "Next Input Field" set on the focused AdvancedInputField instance, but I did a quick Google and it should be possible to control which key gets displayed (Done or Next) on the native keyboard on Android.
    I would need to change the native API of the plugin to pass it which of the 2 keys should be displayed. I'll put it on my TODO list for now.
     
  47. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Hmm...That a weird issue. Are you using the default stock keyboard of that Huawei P8 Lite or a third-party one?
    Could you post a screenshot?

    That SuggestionBar is controlled by the "InputType" property of the AdvancedInputField instance. In the inspector change the "ContentType" to "Custom" and check if the "InputType" is not set to "Autocorrect".
    Note: This is hint send to native keyboard, some devices just ignore it and show it anyways (even if InputType is not autocorrect).

    Could you also test the scrolling behaviour in the sample scene "Form" on that Huawei P8 Lite?
     
  48. MohHeader

    MohHeader

    Joined:
    Aug 12, 2015
    Posts:
    41
    ---
    Edit 2:
    I found that the script needed is already added ( not sure if it was from the editor or I did it by my self in the old days :) )


    if tried to add the script by myself to any GameObject, I get the next warning.


    Edit 3
    I can confirm it is a Unity bug, just commented all the lines, then uncommenting them made it work!

    Sorry!
    -----------------------------
    Hi :)

    not sure if this was posted before, but now just after I updated to the latest plugin version ( 1.8.1 ) from ( 1.7.1 ), I got the following bug.

    when you select an Input field that is going to be hidden behind the keyboard :
    V.1.7.1 : scrollRect would scroll to show the inputField above the keyboard.
    V.1.8.1 : Nothing happen, and it don't scroll as it was before

    Unity 2018.3.0

    am I missing here any migration steps I should follow to keep it working ?

    Thanks
     
    Last edited: Mar 22, 2019
  49. BjoUnity3d

    BjoUnity3d

    Joined:
    Jul 24, 2012
    Posts:
    60
    I'm on 1.8.1 released March 8th. I'm testing on a Pixel 2. It happens even if I just change the text to upper without changing the length of the text:
    void HandleInputChanged(string value)
    {
    value = value.ToUpper();
    inputField.SetText(value, false);
    }

    Results in text typing into the beginning of the field but cursor flashing at end. If I tap on the field to place the cursor after typing each letter it fixes it. My solution was to add this line after setting the text:

    inputField.SetCaretToTextEnd();
     
  50. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Ah, I think I see what happens. If you set the Text on a native Android inputfield the caret gets set to 0. In the SetText() method there is a check to see it last caret position was greater than the text length and correct it when needed and caret gets updated in the native Android InputField immediately. In other cases it will not immediately update the caret immediately. So you need to tell it to what the caret position should be after setting the text at the moment. SetCaretToTextEnd() in your case.

    I'm planning to rewrite the native bindings to support rich text. I'll include a fix for this too at the native side when rewriting.