{"action":"opened","issue":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/3961","repository_url":"https://api.github.com/repos/libgdx/libgdx","labels_url":"https://api.github.com/repos/libgdx/libgdx/issues/3961/labels{/name}","comments_url":"https://api.github.com/repos/libgdx/libgdx/issues/3961/comments","events_url":"https://api.github.com/repos/libgdx/libgdx/issues/3961/events","html_url":"https://github.com/libgdx/libgdx/issues/3961","id":143286749,"number":3961,"title":"TextArea StringIndexOutOfBoundsException thrown after clicking text","user":{"login":"kotcrab","id":4594081,"avatar_url":"https://avatars.githubusercontent.com/u/4594081?v=3","gravatar_id":"","url":"https://api.github.com/users/kotcrab","html_url":"https://github.com/kotcrab","followers_url":"https://api.github.com/users/kotcrab/followers","following_url":"https://api.github.com/users/kotcrab/following{/other_user}","gists_url":"https://api.github.com/users/kotcrab/gists{/gist_id}","starred_url":"https://api.github.com/users/kotcrab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kotcrab/subscriptions","organizations_url":"https://api.github.com/users/kotcrab/orgs","repos_url":"https://api.github.com/users/kotcrab/repos","events_url":"https://api.github.com/users/kotcrab/events{/privacy}","received_events_url":"https://api.github.com/users/kotcrab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-24T16:01:39Z","updated_at":"2016-03-24T16:01:39Z","closed_at":null,"body":"#### Issue details\r\nThere is some issue in `TextArea` that causes `StringIndexOutOfBoundsException` to be thrown. See reproduction steps.\r\n\r\n#### Reproduction steps/code\r\n1. Run standard libgdx's `TextAreaTest`\r\n2. Move cursor to the very end of the text and start clicking repeatedly after last letter\r\n3. After few clicks crash will occur, reproducible every time. From what I tested this doesn't happen in `TextField`.\r\n\r\n[GIF](https://cloud.githubusercontent.com/assets/4594081/14022714/5de36ab2-f1e1-11e5-9b69-3482ecf9fc59.gif)\r\n\r\n#### Version of LibGDX and/or relevant dependencies\r\nLatest source\r\n\r\n#### Stacktrace\r\n```java\r\nException in thread \"LWJGL Application\" java.lang.StringIndexOutOfBoundsException: String index out of range: 7\r\n\tat java.lang.String.charAt(String.java:646)\r\n\tat com.badlogic.gdx.scenes.scene2d.ui.TextField.wordUnderCursor(TextField.java:166)\r\n\tat com.badlogic.gdx.scenes.scene2d.ui.TextField.wordUnderCursor(TextField.java:175)\r\n\tat com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldClickListener.clicked(TextField.java:769)\r\n\tat com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:89)\r\n\tat com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldClickListener.touchUp(TextField.java:795)\r\n\tat com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:58)\r\n\tat com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:353)\r\n\tat com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:332)\r\n\tat com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:215)\r\n\tat com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)\r\n```\r\n\r\n#### Please select the affected platforms\r\n* Windows LWJGL2/LWJGL3\r\n\r\nOthers untested.\r\n"}}