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
- [Android] The Player screen turns black when playing a video under certain conditions
- Search window icons at the bottom are cut off when Search window is resized vertically
- "Try something else?" text label is cut off when searching for a long text in the Search window
- Rendering Debugger window sections do not have a minimum width set when resizing with the slider in the middle of the window
- Last segment of a Sprite Shape Spline is affected by other segments' Sprite Variant change when no edge Sprite is selected
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