-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BACKSPACE on TextField crashes after TextField loses focus #207
Comments
What version of VisUI are you using, can you reproduce with latest 1.1.5? Please tell exact steps to reproduce this. This doesn't work:
|
I have encountered the sam bug but the way to produce it is as follows.
Yes I am using version 1.1.5 Stack trace java.lang.StringIndexOutOfBoundsException: String index out of range: -1 I looked into the code thoroughly and found out that when you click on a text field for regaining focus, it sets the "cursor" int value which should be equal to length of text but when we click it is somehow changing cursor value to text length + 1. When we use tab to change focus, then that works fine. protected void setCursorPosition (float x, float y) { |
Thanks for reproduction steps @Snehks. For some reason I could only reproduce when using LWJGL backend. I fixed it. |
There appears to be a problem with the TextField after it loses and re-gain focus, when backspace is pressed an exception is generated:
Exception in thread "LWJGL Application" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1931)
at com.kotcrab.vis.ui.widget.VisTextField$TextFieldClickListener.keyTyped(VisTextField.java:1206)
The "cursor" field looks to be bigger than the actual word in the textfield.
The text was updated successfully, but these errors were encountered: