Tuesday, July 7, 2009

Test Input field quirk

Along the same lines of the last post about combo box focus and its issues, here is a Text input field issue I found.
If you are listening for keyboard events be aware that whatever text input field has focus on it will pick up the key pressed in its field. It's weird too, you can't get rid of it even by setting the field's text to nothing.
textfield.text = "";

If you set the text to something else the key you hit still occupies the first slot, shaky bug. To avoid it make sure that even when invisible, make sure that no text input fields have focus on them. You could set up a hidden 'ghost' field to have focus on if you need to send focus elsewhere.

No comments:

Post a Comment