Exception when pressed backspace for removing characters after selected all in TMP Inputfield.
>
Like pictures you can see white space then cause exception.
It seems that caretPositionInternal is not equal to length of text.
This happened to both versions 3.0.1 and 3.0.3.
ArgumentOutOfRangeException: Index and count must refer to a location within the string.
Parameter name: count
System.String.Remove (System.Int32 startIndex, System.Int32 count) (at <fb001e01371b4adca20013e0ac763896>:0)
TMPro.TMP_InputField.Backspace () (at Library/PackageCache/com.unity.textmeshpro@3.0.1/Scripts/Runtime/TMP_InputField.cs:2931)
TMPro.TMP_InputField.KeyPressed (UnityEngine.Event evt) (at Library/PackageCache/com.unity.textmeshpro@3.0.1/Scripts/Runtime/TMP_InputField.cs:1898)
TMPro.TMP_InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.textmeshpro@3.0.1/Scripts/Runtime/TMP_InputField.cs:2135)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IUpdateSelectedHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2020.1.8f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:99)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity/Hub/Editor/2020.1.8f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2020.1.8f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:376)
As matter of fact, I got the issue when using not on windows with Unity 2020.1.8f1.
But on mac, exception when using on Unity 2020.1.13f1 with TMP version 3.0.3β¦
May be Itβs problem with different keyboard type or different carat position.(case of me, carat was end position.)