Search Issue Tracker

Fixed in 1.4.2 & 2.0.2

Votes

2

Found in [Package]

1.4.0 - preview.1b

Issue ID

1162514

Regression

Yes

TextMeshPro InputField throws ArgumentOutOfRangeException when emptied with "Hide Mobile Input" enabled

Package: TextMeshPro

-

To reproduce:

1. Download attached "TextMeshProInputFieldCrash.zip" project and open in Unity
2. Open "SampleScene" scene
3. Build for iOS
4. Deploy the Xcode project to the iOS device
5. Click on the InputField
6. Type something
7. Hold down Backspace on the on-screen Keyboard until the Text is completely deleted and hold it for a bit more

Expected results: No Crashes and no Exceptions are being thrown when deleting the Text from the InputField
Actual results: The Game does not crash, but Exceptions are being thrown in the Log:

"ArgumentOutOfRangeException: Selection is out of range.
Parameter name: selection
at UnityEngine.TouchScreenKeyboard.set_selection (UnityEngine.RangeInt value) [0x0003a] in <f87863d3d6d8426eb49e406f337e22e4>:0
at TMPro.TMP_InputField.GenerateCaret (UnityEngine.UI.VertexHelper vbo, UnityEngine.Vector2 roundingOffset) [0x00109] in <9018cd3bccf849d69e032463692a8446>:0
at TMPro.TMP_InputField.OnFillVBO (UnityEngine.Mesh vbo) [0x0009f] in <9018cd3bccf849d69e032463692a8446>:0
at TMPro.TMP_InputField.UpdateGeometry () [0x0001f] in <9018cd3bccf849d69e032463692a8446>:0
at TMPro.TMP_InputField.Rebuild (UnityEngine.UI.CanvasUpdate update) [0x00004] in <9018cd3bccf849d69e032463692a8446>:0
at UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () [0x00121] in <47839348810e43629ed4e6a410217b7e>:0"

Notes:
- This issue happens on both iOS and Android
- This issue does do not reproduces if the "Hide Mobile Input" flag on the InputField is disabled

Tested with:
- iPhone 8 Plus, iOS: 12.0 - Reproduced
- iPhone XR, iOS: 12.0 - Reproduced

Reproduced on Package version 1.4.0 - preview.1b and 2.0.1
Not reproduced on Package version 1.3.0
Regression on Package version 1.4.0 - preview.1b

Reproduced on Unity 2018.4.3f1, 2019.1.7f1, 2019.2.0b6 and 2019.3.0a7

  1. Response avatar

    Resolution Note (fix version 1.4.2 & 2.0.2):

    This issue has been resolved and will be fixed in the next release of the TextMesh Pro package which will be version 1.4.2 for Unity 2018.4 and 2.0.2 for Unity 2019.x.

Comments (11)

  1. C06d7fd20415bc151ce3d4258a15919f?d=mm

    nekokiller2021

    Sep 16, 2021 06:20

    still happened on unity 2019.4.23f1

  2. 22d18f40f4c1834e19bd179d1fff98d7?d=mm

    TANGSTENcq

    Aug 01, 2021 21:55

    This issue is still plaguing UWP on the HoloLens 2 with Unity version 2019.4.28f1, MRTK 2.7 2. The MRTK keyboard is disappearing while typing in an TMP Inputfield. The issue appears when UnityEngine.TouchScreenKeyboard.set_selection is called. Here is the error message: ArgumentOutOfRangeException: Selection is out of range.
    Parameter name: selection

    UnityEngine.TouchScreenKeyboard.set_selection (UnityEngine.RangeInt value) (at <00000000000000000000000000000000>:0)
    TMPro.TMP_InputField.ActivateInputFieldInternal () (at <00000000000000000000000000000000>:0)
    TMPro.TMP_InputField.LateUpdate () (at <00000000000000000000000000000000>:0)

    The moment that exception is thrown the keyboard closes on HoloLens 2. This issue has been seemingly around for a long time. This issue should be reopened.

  3. 73408c1a7b8662b9bd23e56993f0122a?d=mm

    tyler_unity846

    Jan 27, 2021 19:16

    Same issue in Unity 2019.4.17f1.
    *Note: This issue DOES still occur even if the "Hide Mobile Input" flag on the InputField(TMP or Unity) is disabled contrary to the information in the issue ticket above

    Log snippet:
    ArgumentOutOfRangeException: Selection is out of range.
    Parameter name: selection
    at UnityEngine.TouchScreenKeyboard.set_selection (UnityEngine.RangeInt value) [0x00000] in <00000000000000000000000000000000>:0
    at TMPro.TMP_InputField.ActivateInputFieldInternal () [0x00000] in <00000000000000000000000000000000>:0
    at TMPro.TMP_InputField.LateUpdate () [0x00000] in <00000000000000000000000000000000>:0

  4. A57f2f452bbe6097c4aed7e665b918ed?d=mm

    sp-LeventeLajtai

    Dec 18, 2020 12:04

    This bug was fixed in TMP 2.1.0, but had other bugs, and has returned for at least Android devices with TMP 2.1.3.

  5. E173402a59eb2eb9da9f19bfa891c54e?d=mm

    Nico8292

    Nov 24, 2020 10:27

    Still happening with normal Inputfield on 2019.4.3f1

  6. D0bf7dcedbe4266e44d1a8d58085054b?d=mm

    SyedUmair

    Oct 21, 2020 11:07

    occurs for normal UGUI InputField as well. Reported by Unity Diagnostics and crash reports.
    Using Unity 2019.4.12

    Devices: Multiple android devices

    STACK TRACE:

    UnityEngine.TouchScreenKeyboard.set_selection (UnityEngine.RangeInt value) (at <00000000000000000000000000000000>:0)
    UnityEngine.UI.InputField.LateUpdate () (at <00000000000000000000000000000000>:0)

  7. 28306d067bed4023d53ac0d237a93fbd?d=mm

    cg_augmentaio

    Aug 20, 2020 11:07

    still not fixed. Using Unity 2019.3 and TMP 2.1.0 with UWP for Hololens

  8. A80e9b234d2a0689d63f4f0a4cdbf371?d=mm

    AdamVlcek

    Jul 10, 2020 13:12

    Is there any related bug report for Unity.UI? Any progress in any release notes? This issue seems very unresolved to me. Using Unity 2019.x and TMP 2.1.0 prev 14.

    In fact, the whole text input in Unity is so broken, that it's nearly unusable! Such a basic thing should receive much more attention!

  9. 9d732c57b8a65d1e56ab097be0ffed94?d=mm

    RendergonPolygons

    May 19, 2020 02:24

    this isn't fixed, this bug still present for builds on UWP Unity 2019.3.13

  10. 8158c103d4fc19f931153cef02fde79b?d=mm

    DevionNL

    May 15, 2020 09:32

    Yep, as Sailendu said - happens with normal InputField UI as well.

    UnityEngine.TouchScreenKeyboard.set_selection (UnityEngine.RangeInt value) (at <00000000000000000000000000000000>:0)
    UnityEngine.UI.InputField.LateUpdate () (at <00000000000000000000000000000000>:0)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.