Why doesn’t TextField valueBind correctly when overriding the keyUp function? Example here http://jsfiddle.net/z5SNW/3/ .Basically I am alerting the value of the TextField whenever enter is pressed or the user clicks the button. The problem is pressing the button doesn’t show the actual value until you focus out of the text field, and then click the button.
I can hack it by putting an else into the keyUp function and set the value there, but that doesn’t seem right to me. I think I am just missing something really simple.
By overriding
keyUpthe value of the TextField is only set when thechangeevent is fired (on focus lost), see code.If you use the available
insertNewlinefor your handling of enter, everything works: http://jsfiddle.net/z5SNW/6/.Or you keep your implementation of
keyUp(if you plan to act on other keyCode’s as well, but then you have to callthis.interpretKeyEvents(event);, see http://jsfiddle.net/z5SNW/8/.