How to reproduce:
1. Create and open a new project
2. Open Edit → Project Settings → UI Toolkit and enable the “Advanced Text Generator“
3. Create a UI Document in the Project tab and open it
4. Add a TextField Control to the Hierarchy and Enable “RTL” Language Direction attribute and “Advanced“ in Text → Text Generator Type attribute
5. Save the changes
6. Create a new UI Toolkit → UI Document GameObject in the Scene and attach the UI Document to the required field in the Inspector
7. Enter Play Mode
8. Type anything into the TextField, navigate to the middle of the string, then try to delete any character (either with the delete or backspace buttons)
9. Observe the Console
Expected result: Letters are deleted, no Console errors are thrown
Actual result: “ArgumentOutOfRangeException: Count cannot be less than zero“ is thrown in the Console, and letters are not deleted
Reproducible in: 6000.0.57f1, 6000.2.4f1, 6000.3.0b1
Not reproducible in: 6000.0.56f1
Reproduced on: Windows 11 Pro (24H2)
Not reproduced on: No other environment tested
Notes:
- If multiple letters are selected, they can be deleted
- If the caret is at the beginning of the string, it will not delete the letters, but it will not throw errors either