Search Unity

Advanced Input Field 2

Discussion in 'Assets and Asset Store' started by fennecx_development, Dec 25, 2020.

  1. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    @fennecx_support
    It seems like on iOS using 2021.1 i;m seeing a bug where entering values in one inputfield also enters the same value inanother input field at same time. Did someone else reported this bug also?
     
  2. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Found the bug and its in your plugin, if we have 2 input fields where one type is username and other's type is email then this happens on iOS only
    Please check and provide its fix
     
  3. ageana

    ageana

    Joined:
    Nov 6, 2013
    Posts:
    48
    Is there a way to enable 3rd-party keyboard support on iOS? It seems that the plugin doesn't show other keyboards available on the device.
     
    jGate99 likes this.
  4. mikejm_

    mikejm_

    Joined:
    Oct 9, 2021
    Posts:
    346
    This is embarrassingly stupid but I'll just post it here for the record anyway as it's a credit to your good support.

    You sent me an empty project by PM with the emoji asset generator functioning to demonstrate how this should work. From that, I realized I hadn't downloaded emoji.json properly. It looks like I saved an HTML page from GitHub as "emoji.json." I must have stupidly either right clicked a link and gone "save as" or saved a web display version of the "emoji.json" code.

    Anyway, as soon as I fixed the "emoji.json" file to actually have the code it was obviously supposed to have it worked.

    Thanks for being diligent as always and thanks for helping me fix/identify the problem. It's working normally now.
     
  5. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    now realizing this, i really need this support otherwise plugin is not usable

    Just to be sure? does it mean nokeyboard will appear at all? or just the other
     
  6. ageana

    ageana

    Joined:
    Nov 6, 2013
    Posts:
    48
    No, the system keyboard appears, but if you install other keyboards on iOS, they don't show up in the list when typing something in the input.
     
    jGate99 likes this.
  7. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Hi @fennecx_support
    Can you please provide me sampe scene where keyboards pushes content so field is not hidden?
     
  8. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Found it, so we have to use Keyboard scroller component to ScrollRect, thats it?
     
  9. PrisedRabbit

    PrisedRabbit

    Joined:
    Aug 14, 2012
    Posts:
    63
    https://forum.unity.com/threads/issues-with-app-built-for-ios-15-and-xcode-13.1178437/#post-7632973
     
  10. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Hi @fennecx_support
    How do i enforce my email field for user to enter letters in smallcase (or turn all the entered letters in smallcase)?
     
  11. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    paste option is not working , paste function is working only on replace time and empty input filed press and holding finger upto 1 second. when i input some value and then i am trying to press and hold finger upto 1 second paste option didn't appear
    Please check this issue and let me know how can i fix this issue
    thank you
     
  12. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    Hi, I have a custom script for a Scroll Rect that is contained in the namespace UnityEngine.UI. I'd like the Keyboard Scroller.cs use it instead of a classic ScrollRect, but I can't to reference it, even if I change references in AssemblyDefinition or if I create a new one and pass it to the ASMDEF of AdvancedInputField.

    How can I solve this?
     
  13. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Verified that it works on some inputfields and not on others using the "Form" sample scene and the Swift keyboard. When googling I came across this thread: https://stackoverflow.com/questions/47884864/uitextfield-doesnt-allow-3rd-party-keyboard
    It mentions that fields that are marked as secure (or what iOS automatically forces as secure) blocks third party keyboards.
    On the AdvancedInputField side this gets controlled by the "AutofillType" property. Username and password autofilltype always seems to be considered as secure by iOS for example.

    I've attached a small modification to the iOS library of the plugin to explicitly set the secure property to false on all native non password fields, which seems to fix it for some autofillTypes.
     

    Attached Files:

  14. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Yes, you can use that component if you want it scroll the content inside a ScrollRect. You could also add an listener to the OnKeyboardHeightChanged event if you want handle the content move yourself. The Documentation file explains this in more depth.
     
  15. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    You could create a (custom) CharacterValidator and set a rule that all characters in the uppercase range have the action TO_LOWERCASE. See the Documentation file (and CharacterValidator sample scene) for more details.
     
  16. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    I only see the issue that the paste action won't appear after typing something and ending it with a space character and then holding finger for 1 second. Is this issue you are having?
    (You can still show the paste action by tapping the blue cursor in this scenario)
    When holding next to a word or in a word it normally should select the whole word and display multiple actions (including paste action).
     
  17. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    As far as I know AssemblyDefinition files cannot reference each other, creating a circular dependency. What you could do is just copy the code of the KeyboardScroller.cs file and make a new script in your own assembly.
     
    Becreatives likes this.
  18. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    thanks for support me all other features are working fine only one issue i am getting please help me how can i fix this issue
    I only see the issue that the paste action won't appear after typing something and ending it with a space character and then holding finger for 1 second. Is this issue you are having?

    thank you
     
  19. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    Yes, ok I didn't thought to this solution. It's a workaround but for now it works. Thank you
     
  20. wuy420

    wuy420

    Joined:
    Apr 22, 2019
    Posts:
    17
    Hi! I was trying to use the advanced input field with Unity default text and followed this instruction to make Unity as an library to a native iOS app. https://github.com/Unity-Technologies/uaal-example/blob/master/docs/ios.md

    I successfully launched Unity feature and everything worked well except this advanced input field. When I tapped on the input field, the app crashed and I saw these errors:

    2022-01-26 13:04:34.327926-0500 NativeiOSApp[12492:2343505] +[NSString fromUnityString:]: unrecognized selector sent to class 0x1dd2d36e8

    2022-01-26 13:04:34.483971-0500 NativeiOSApp[12492:2343505] Uncaught exception: NSInvalidArgumentException: +[NSString fromUnityString:]: unrecognized selector sent to class 0x1dd2d36e8

    (

    0 CoreFoundation 0x0000000183c5f070 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 626800

    1 libobjc.A.dylib 0x000000019c179f54 objc_exception_throw + 60

    2 CoreFoundation 0x0000000183d3bf4c 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 1531724

    3 CoreFoundation 0x0000000183bf4484 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 189572

    4 CoreFoundation 0x0000000183bf35c0 _CF_forwarding_prep_0 + 96

    5 UnityFramework 0x00000001152f4be4 _nativeKeyboard_showKeyboard + 84

    6 UnityFramework 0x0000000115a65440 IOSKeyboard__nativeKeyboard_showKeyboard_m4BAD9817E5A498A47D81D93289B44AC6BF0B3879 + 84

    7 UnityFramework 0x0000000115a65bc4 IOSKeyboard_ShowKeyboard_mB6B08E60DE85B43BFF0A1922D511F09B96D4B4F0 + 132

    8 UnityFramework 0x0000000113f8e7e4 _ZN18VirtActionInvoker4IP8String_tiiP69NativeKeyboardConfiguration_tD077CBD35EAC85E2166704C43717213BCCD8812FE6InvokeEtP12Il2CppObjectS1_iiS3_ + 132

    9 UnityFramework 0x0000000115a78dd0 KeyboardClient_ShowKeyboard_m1CAC7525689490149FEEF6472882B834CB9935D0 + 120

    10 UnityFramework 0x0000000115a4e6bc InputFieldEngine_LoadKeyboard_m3B5BEBB2295C15F030737BCAAB7E724C706AC42E + 2400

    11 UnityFramework 0x0000000115a71088 InputFieldEngine_EnableSelection_m421EB76EB0E27B51EF2114ADA5B43242E6CB4C1B + 1060

    12 UnityFramework 0x0000000115a702f4 InputFieldEngine_CheckClick_m7F5B07D0251B8E476A81CFB1339C1B358DAD9E14 + 1984

    13 UnityFramework 0x0000000115a56794 InputFieldEngine_OnPointerUp_m3DDEA06A7B00C7280C429AF3B6701E8CCB18EC73 + 276

    14 UnityFramework 0x0000000115a56644 AdvancedInputField_OnPointerUp_m5556B428836868E56786195B573D5677CE1C3C27 + 140

    15 UnityFramework 0x0000000113f8c858 _ZN23InterfaceActionInvoker1IP58PointerEventData_tC6C1BEE9D4C8755A31DA7FC0C9A1F28A36456954E6InvokeEtP11Il2CppClassP12Il2CppObjectS1_ + 288

    16 UnityFramework 0x0000000115aa0948 ScrollArea_OnPointerUp_m3EC0B617789C8453EEE8B0E51E131F621829734E + 232

    17 UnityFramework 0x0000000113f8c858 _ZN23InterfaceActionInvoker1IP58PointerEventData_tC6C1BEE9D4C8755A31DA7FC0C9A1F28A36456954E6InvokeEtP11Il2CppClassP12Il2CppObjectS1_ + 288

    18 UnityFramework 0x0000000116eb6464 ExecuteEvents_Execute_m23EBAEDBD5BC357A390497842D990218AF973B85 + 224

    19 UnityFramework 0x00000001164152e8 EventFunction_1_Invoke_mABDD3477D1119860783D5F9F20AB8E9996113F2D_gshared + 260

    20 UnityFramework 0x0000000116179f10 ExecuteEvents_Execute_TisRuntimeObject_m20F4B1FD39A6BA916CF0A469A0D71DE4DC727B26_gshared + 1276

    21 UnityFramework 0x000000011442eea0 _Z126ExecuteEvents_Execute_TisIPointerUpHandler_t9B0CCCD8169032FD78C8D22CAFC3A89E1709A180_m97673FB8C4F7988E3AB925901A55AEF15FD52F91P52GameObject_tC000A2E1A7CF1E10FD7BA08863287C072207C319P55BaseEventData_t722C48843CF21B50E06CC0E2E679415E38A7444EP57EventFunction_1_t7FBE64714A4E50EF106796C42BB2493D33F6C7CAPK10MethodInfo + 48

    22 UnityFramework 0x0000000116f27fd4 StandaloneInputModule_ProcessTouchPress_m1ACFC2288CC51BD8C85C6894994923B1762B0B49 + 3392

    23 UnityFramework 0x0000000116f265dc StandaloneInputModule_ProcessTouchEvents_m2C06F4FED9D3F300031E889330180C5004034DBA + 396

    24 UnityFramework 0x0000000116f26014 StandaloneInputModule_Process_mEA8D89C754B958916467AEB75592670B15519D98 + 220

    25 UnityFramework 0x0000000113f85a2c _ZN18VirtActionInvoker06InvokeEtP12Il2CppObject + 100

    26 UnityFramework 0x0000000116eb525c EventSystem_Update_mF0C1580BB2C9A125C27282F471DB4DE6B772DE6D + 1228

    27 UnityFramework 0x000000011428e5ec _Z65RuntimeInvoker_TrueVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5PFvvEPK10MethodInfoPvPS4_ + 44

    28 UnityFramework 0x00000001152d3324 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 116

    29 UnityFramework 0x00000001149eb65c _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 124

    30 UnityFramework 0x00000001149f748c _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 120

    31 UnityFramework 0x0000000114a03114 _ZN13MonoBehaviour16CallUpdateMethodEi + 272

    32 UnityFramework 0x00000001148256d4 _ZN20BaseBehaviourManager12CommonUpdateI16BehaviourManagerEEvv + 228

    33 UnityFramework 0x00000001148f2b6c _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 100

    34 UnityFramework 0x00000001148f2bac _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 164

    35 UnityFramework 0x00000001148f2e78 _Z10PlayerLoopv + 272

    36 UnityFramework 0x0000000114ddb51c _ZL19UnityPlayerLoopImplb + 112

    37 UnityFramework 0x0000000113f75ee0 UnityRepaint + 28

    38 UnityFramework 0x0000000113f75eb8 -[UnityAppController(Rendering) repaint] + 116

    39 UnityFramework 0x0000000113f75e04 -[UnityAppController(Rendering) repaintDisplayLink] + 128

    40 QuartzCore 0x000000018792820c 8AB30EEB-FB15-36CB-9C27-918ED68500EE + 66060

    41 QuartzCore 0x000000018792eb60 8AB30EEB-FB15-36CB-9C27-918ED68500EE + 93024

    42 CoreFoundation 0x0000000183bd13a0 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 45984

    43 CoreFoundation 0x0000000183c14734 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 321332

    44 CoreFoundation 0x0000000183c17f40 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 335680

    45 CoreFoundation 0x0000000183bd1e1c 6174789A-E88C-3F5C-BA39-DE2E9EDC0750 + 48668

    46 CoreFoundation 0x0000000183be53c8 CFRunLoopRunSpecific + 600

    47 GraphicsServices 0x000000019f3f638c GSEventRunModal + 164

    48 UIKitCore 0x000000018658b060 C46A087A-E13A-3AED-A8A1-D4CC4AC9948A + 5353568

    49 UIKitCore 0x0000000186308b8c UIApplicationMain + 2124

    50 NativeiOSApp 0x0000000104ac5570 main + 132

    51 dyld 0x0000000104ceda24 start + 520

    )

    2022-01-26 13:04:34.490118-0500 NativeiOSApp[12492:2343505] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString fromUnityString:]: unrecognized selector sent to class 0x1dd2d36e8'

    *** First throw call stack:

    (0x183c5f05c 0x19c179f54 0x183d3bf4c 0x183bf4484 0x183bf35c0 0x1152f4be4 0x115a65440 0x115a65bc4 0x113f8e7e4 0x115a78dd0 0x115a4e6bc 0x115a71088 0x115a702f4 0x115a56794 0x115a56644 0x113f8c858 0x115aa0948 0x113f8c858 0x116eb6464 0x1164152e8 0x116179f10 0x11442eea0 0x116f27fd4 0x116f265dc 0x116f26014 0x113f85a2c 0x116eb525c 0x11428e5ec 0x1152d3324 0x1149eb65c 0x1149f748c 0x114a03114 0x1148256d4 0x1148f2b6c 0x1148f2bac 0x1148f2e78 0x114ddb51c 0x113f75ee0 0x113f75eb8 0x113f75e04 0x18792820c 0x18792eb60 0x183bd13a0 0x183c14734 0x183c17f40 0x183bd1e1c 0x183be53c8 0x19f3f638c 0x18658b060 0x186308b8c 0x104ac5570 0x104ceda24)

    libc++abi: terminating with uncaught exception of type NSException

    dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString fromUnityString:]: unrecognized selector sent to class 0x1dd2d36e8'

    terminating with uncaught exception of type NSException
     
  21. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    i am waiting for your replay please give me response
     
  22. Mekumyanov

    Mekumyanov

    Joined:
    Mar 31, 2017
    Posts:
    7
    Hi again!
    Yes, clicking on the cursor shows the ActionBar, but tapping on the InputField itself does not show it. That is, according to the usual behavior of Android, you can call the ActionBar by clicking on any place where text is entered, not necessarily at the cursor. Can this be fixed somehow?
     
  23. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Hi @fennecx_support
    On some android devices, Manaul Select doesnt show keyboard even though text input is in editing mode with blinking cursor
     
  24. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    paste action won't appear after typing something and ending it with a space character and then holding finger for 1 second

    Please help me how can i solve this issue
     
  25. anton_pushkin2

    anton_pushkin2

    Joined:
    Aug 20, 2021
    Posts:
    6
    Hi everyone, how can I change the asteriskChar for password from * to • ?
    asteriskChar is a field that exists in regular InputField, but I cannot seem to find the same thing in this asset
     
  26. anton_pushkin2

    anton_pushkin2

    Joined:
    Aug 20, 2021
    Posts:
    6
    Found an answer to my own question. There is no option for it, but you could change it manually in InputFieldEngine.cs (see the attached screenshot) upload_2022-2-1_14-47-55.png
     
  27. anton_pushkin2

    anton_pushkin2

    Joined:
    Aug 20, 2021
    Posts:
    6
    Does any body know how to get an event from pressing copy/paste/cut/selectAll action items?
     
  28. reality_marcin

    reality_marcin

    Joined:
    Jan 4, 2022
    Posts:
    2
    @fennecx_support hi, I have a crash on iOS, any time i have input field pre-populated with emojis only string and i want to edit this text it crashes. Just try to edit emoji only text, it crashes on inserting character, in onTextEditUpdate calling [NSString toUnityString], seems like problem with getting length. What can I do with that crash? Can I fix it somehow? Thanks for help.
     

    Attached Files:

  29. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    I'm not really familiar with this way of building and how it includes iOS library files (.a) files into the final project. If the NativeKeyboard.a is somewhere accessible in your XCode project, I think you need use the "-force_load" option in "
    OTHER_LDFLAGS" in XCode to make it use the NativeKeyboard.a file. Normally this gets done automatically by the
    PostProcessBuild.cs (located in Assets/AdvancedInputField/Editor/Scripts) when making an iOS build in the Unity Editor, but in your case this might not get executed.
     
  30. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    To make it show the ActionBar when holding (even when last character is a space character or other special character) change the OnHold() method in TextNavigator.cs to this:

    Code (CSharp):
    1. internal virtual void OnHold(Vector2 position)
    2.         {
    3.             if(InputField.Text.Length > 0)
    4.             {
    5.                 TextNavigator.SelectCurrentWord();
    6.                 if(!Engine.HasSelection) //Just show the ActionBar when no word was selected
    7.                 {
    8.                     if(TextNavigator.ActionBar == null)
    9.                     {
    10.                         InitActionBar(Engine);
    11.                     }
    12.                     TextNavigator.ShowActionBar();
    13.                 }
    14.             }
    15.             else if(InputField.CanUseActionBar)
    16.             {
    17.                 if(TextNavigator.ActionBar == null)
    18.                 {
    19.                     InitActionBar(Engine);
    20.                 }
    21.                 TextNavigator.ShowActionBar();
    22.                 if(!Engine.EditMode)
    23.                 {
    24.                     TextNavigator.KeepActionBarVisible = true; //Workaround to keep the ActionBar visible when beginning edit mode
    25.                 }
    26.             }
    27.         }
     
  31. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Is this consistent on those devices or randomly?
    Are there any errors in the log on those devices?
     
  32. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    I can add a property for this in next release.
     
  33. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Not specifically from the default ActionBar actions, but there are events for text value & text selection changes. Is there a specific reason you need to detect those actions?
     
  34. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    There are some emoji encoding differences between C# and native Android/iOS, so it might not get encoded correctly when send to native iOS.
    Are you populating the inputfield text in the inspector or from code?
    Would it be possible to make a small repro project or send the emoji string you are currently trying to use?
     
  35. Mekumyanov

    Mekumyanov

    Joined:
    Mar 31, 2017
    Posts:
    7
    @fennecx_support Is it possible to edit this?
     
  36. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    i am using emoji asset emoji is input and showing fine on device but i am trying to added emoji remove using backspace and delete first time working perfect but reselect input and then i am trying to remove emoji it's not working and getting this error Pc or device. let me know how can i fixed
    i think error saying advanceinputfiled text is empty but in text object value is field please see on last screenshot
     

    Attached Files:

  37. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    i am checking but i didn't found this method on TextNavigator.cs i found on TextInputHandler.cs so can change this method in to TextInputHandler.cs?
     
  38. anton_pushkin2

    anton_pushkin2

    Joined:
    Aug 20, 2021
    Posts:
    6
    Yeah, I would like to show 'Copied' popup every time the user copies the text, is there any way to do that with this asset? So far I've created my own static actions from inside the plugin
     
  39. wuy420

    wuy420

    Joined:
    Apr 22, 2019
    Posts:
    17
    Is there a iOS OS version limitation of this Advanced Input Field?
     
  40. reality_marcin

    reality_marcin

    Joined:
    Jan 4, 2022
    Posts:
    2
    It's set programmatically via field.Text = playerName;
    It looks like on that screenshot, when I try to edit such text it crashes on inserting that new character. It doesn't crash when there is at least one alphanumeric letter. It crashes only on emoji-only strings. Can you please somehow try to reproduce it on ios? Just set text to emoji on field initialization and try to edit that text.
     

    Attached Files:

  41. anton_pushkin2

    anton_pushkin2

    Joined:
    Aug 20, 2021
    Posts:
    6
    When using the plugin on standalone, actionbar does not display Copy and Cut options, it only shows Select All and Paste, why is that? could I do something about it?
    upload_2022-2-2_22-0-51.png
     
  42. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    let me know once you found the solution i am waiting for your replay
    thank you
     
  43. thomas_triplefun

    thomas_triplefun

    Joined:
    Sep 24, 2014
    Posts:
    25
    Hi, thank you for your plugin, the emoji and keyboard support is awesome.
    I also have a "not satisfying" behaviour with the keyboard height changed signal, the signal is really delayed on android an much more on iOS.
    I tried to find a solution and manage the keyboard height in a different way, and I find the KeyboardState on the NativeKeyboard.cs.

    With that I've manage the keyboardHeight this way:
    Code (CSharp):
    1. public void Update()
    2.     {
    3.         if(this.m_previousKeyboardState != NativeKeyboardManager.KeyboardState)
    4.         {
    5.             if((NativeKeyboardManager.KeyboardState == KeyboardState.HIDDEN || NativeKeyboardManager.KeyboardState == KeyboardState.PENDING_HIDE) && (this.m_previousKeyboardState != KeyboardState.HIDDEN && this.m_previousKeyboardState != KeyboardState.PENDING_HIDE))
    6.                 this._onKeyboardHide();
    7.             else if((NativeKeyboardManager.KeyboardState == KeyboardState.VISIBLE || NativeKeyboardManager.KeyboardState == KeyboardState.PENDING_SHOW) && (this.m_previousKeyboardState != KeyboardState.VISIBLE && this.m_previousKeyboardState != KeyboardState.PENDING_SHOW))
    8.                 this._onKeyboardOpen();
    9.             this.m_previousKeyboardState = NativeKeyboardManager.KeyboardState;
    10.         }
    11.     }
    Code (CSharp):
    1. private void _onKeyboardHeightChanged(int keyboardHeight)
    2.     {
    3.         if(keyboardHeight == 0f)
    4.             return;
    5.      
    6.         float keyboardHeightFloat = 0f;
    7.         if(keyboardHeight > 0)
    8.             keyboardHeightFloat = (keyboardHeight / this.m_canvas.scaleFactor) - this.m_start_position_container_from_bottom_y;
    9.  
    10.         // first time we got the keyboard visible and not open yet
    11.         if(CustomInputField.M_OPEN_KEYBOARD_HEIGHT == -1f && NativeKeyboardManager.KeyboardState == KeyboardState.VISIBLE)
    12.         {
    13.             CustomInputField.M_OPEN_KEYBOARD_HEIGHT = keyboardHeightFloat;      
    14.             this.m_containerRectTransform.offsetMin = new Vector2(this.m_containerRectTransform.offsetMin.x, keyboardHeightFloat);
    15.             this.m_containerRectTransform.offsetMax = new Vector2(this.m_containerRectTransform.offsetMax.x, this.m_containerRectTransform.offsetMax.y);
    16.             this.m_currentKeyboardHeight            = keyboardHeightFloat;
    17.         }
    18.         else if(CustomInputField.M_OPEN_KEYBOARD_HEIGHT != -1f && NativeKeyboardManager.KeyboardState == KeyboardState.VISIBLE && this.m_currentKeyboardHeight != keyboardHeightFloat) // when the keyboard is set but not same height
    19.         {
    20.             this.m_containerRectTransform.offsetMin = new Vector2(this.m_containerRectTransform.offsetMin.x, keyboardHeightFloat);
    21.             this.m_containerRectTransform.offsetMax = new Vector2(this.m_containerRectTransform.offsetMax.x, this.m_containerRectTransform.offsetMax.y);
    22.             this.m_currentKeyboardHeight = keyboardHeightFloat;
    23.         }
    24.     }
    As you can see I still used the onKeyboardHeightChanged signal to get it properly, but add a check of the keyboard status on an Update to directly changed the height if the status is Pending_Hide or Pending_Show.

    I had to add a getter of the keyboard status in the NativeKeyboardManager.cs, and it's not perfect for future updates...

    With this code the hide behaviour is perfect, the ui is responsive without delay thanks to the Pending_Hide check.
    On iOS the show behaviour is perfect too (once we've open first with the static height saved)
    BUT on Android, I've got the KeyboardState.VISIBLE with the WRONG height, and that cause a laggy visual trick...

    What I suggest is maybe to modify how the PENDING_SHOW keyboard state is managed, to stay pending until the keyboard is fully open ?

    I hope I've been detailed enough to be clear, let me know if you need more information.
    Thank you.
     
    Last edited: Feb 4, 2022
  44. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Yes, sorry, I meant TextInputHandler.cs
     
  45. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    No really, the current implementation relies on a specific caret position or text selection to determine what possible actions it should show and where in the text it should execute that action.
    What's your use case? Do you need to show a custom action only (without the default copy, paste, select all)?
     
  46. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    There is only an click callback for custom ActionBar actions, but could add an event property that triggers for any ActionBar action in next release.
     
  47. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Do you mean the minimum iOS version it supports? Then the answer is the lowest iOS version that the latest version of XCode still supports.
     
  48. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Found an issue related to setting text with emoji from code (which seemed to give the same error you posted).
    To fix I changed SetText() in AdvancedInputField.cs to this:

    Code (CSharp):
    1. public void SetText(string text, bool invokeTextChangeEvent = false)
    2.        {
    3.            if(text == null) { text = string.Empty; }
    4.  
    5.            if(this.text != text)
    6.            {
    7.                Engine.SetText(text, invokeTextChangeEvent);
    8.                Engine.SetSelection(0, 0);
    9.  
    10.                if(Application.isPlaying)
    11.                {
    12.                    if(ShouldUseRichText)
    13.                    {
    14.                        Engine.RichTextProcessor.SetupRichText(text);
    15.                        Engine.SetRichText(Engine.RichTextProcessor.RichText);
    16.                        Engine.SetRichTextSelection(0, 0);
    17.                    }
    18.                    else if(LiveDecoration)
    19.                    {
    20.                        string processedText = LiveDecorationFilter.ProcessText(text, CaretPosition);
    21.                        if(processedText != null)
    22.                        {
    23.                            Engine.SetProcessedText(processedText);
    24.                            Engine.SetProcessedSelection(0, 0);
    25.                        }
    26.                    }
    27.                    else if(PostDecoration && !Selected)
    28.                    {
    29.                        if(PostDecorationFilter.ProcessText(text, out string processedText))
    30.                        {
    31.                            Engine.SetProcessedText(processedText);
    32.                            Engine.SetProcessedSelection(0, 0);
    33.                        }
    34.                    }
    35.                }
    36.            }
    37.        }
     
    reality_marcin likes this.
  49. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    Is the issue only on Standalone platform?
    Normally you can toggle the default actions you want to support on the ActionBar for a specific AdvancedInputField.
    (See "Other" section in the inspector on an AdvancedInputField instance).
    Also, if the field is marked as a password field it will not show those actions.
     
  50. fennecx_support

    fennecx_support

    Joined:
    Dec 28, 2020
    Posts:
    133
    This lag issue exists because the native Android and iOS API don't actually provide a nice way to get the keyboard height (or an event that detects changes). So the plugin kinda uses a ugly native view sizes monitoring workaround to detect the keyboard height changes. (This is also the way that most people online suggest to detect this.)
    The issue with this solution is that the sizes of those native view don't immediately update when the keyboard appears (as you have noticed). The plugin doesn't know beforehand what the full height of the keyboard will be, so it marks the keyboard as visible as soon as it detect a height value greater than zero.
     
    thomas_triplefun likes this.