Search Issue Tracker
Fixed in 2.2.0-preview.3, 3.2.0-pre.3
Votes
0
Found in [Package]
3.2.0-pre.1
Issue ID
1361032
Regression
No
"IndexOutOfRangeException" is thrown when selecting overflowing TextMeshPro-Text with Ellipse Overflow enabled
Steps to reproduce:
1. Open the attached project "TMPBug.zip"
2. Open Scenes>SampleScene
3. Enter the Play Mode
4. Click on the Input Field in the Game View
5. Type any symbol
6. Click on the Input Field in the Game View
7. Observe the Console window
Expected results: No errors are thrown
Actual result: "IndexOutOfRangeException" is thrown
Reproducible with: 2.1.6 (2019.4.30f1), 3.2.0-pre.1 (2020.3.17f1, 2021.1.19f1, 2021.2.0b8, 2022.1.0a7)
Full error:
IndexOutOfRangeException: Index was outside the bounds of the array.
TMPro.TMP_TextUtilities.FindNearestCharacterOnLine (TMPro.TMP_Text text, UnityEngine.Vector3 position, System.Int32 line, UnityEngine.Camera camera, System.Boolean visibleOnly) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_TextUtilities.cs:242)
TMPro.TMP_TextUtilities.GetCursorIndexFromPosition (TMPro.TMP_Text textComponent, UnityEngine.Vector3 position, UnityEngine.Camera camera, TMPro.CaretPosition& cursor) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_TextUtilities.cs:146)
TMPro.TMP_InputField.OnPointerDown (UnityEngine.EventSystems.PointerEventData eventData) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_InputField.cs:1805)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerDownHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:36)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update() (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:377)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on UnityEngine::Animation::SetGenericFloatPropertyValues when keyframing the RigBuilder component to Enabled and Disabled
- TabViews overlap and do not adjust when there are too many TabViews
- Asset import fails when importing the Shader Graph "Production Ready Shaders" sample
- [Android] The Player silently crashes and the "java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity" error is logged when the "Render Over Native UI" setting is enabled
- The "Add Tag..." text field is visually cut off when the screen scale is 250% or more
Resolution Note (fix version 2.2.0-preview.3, 3.2.0-pre.3):
Fixed in TextMeshPro 3.2.0-pre.3 available in 2020.3.0f1 and above