TaterSalad
16 Oct 2008, 8:28 AM
It seems if I create a TextField and I do field.getValue() on keydown, keyup, or keypress, I don't get the value of that just-added key. Instead I get whatever was in the field just prior to the keypress. If I add a 10ms delay I get the right value, though.
Since this seems a fairly common use case for these events, it would be nice if the execution of the two processes (adding the key to the value, and firing the event) were re-ordered. Or if they are already in order and it's a race condition, adding a lock or follow up check to ensure the expected value is returned.
For keydown I think either way is fine.
But for keyup and keypress, the value is visible and the user interaction is done, so getValue() should return the full shown value.
Thanks
Since this seems a fairly common use case for these events, it would be nice if the execution of the two processes (adding the key to the value, and firing the event) were re-ordered. Or if they are already in order and it's a race condition, adding a lock or follow up check to ensure the expected value is returned.
For keydown I think either way is fine.
But for keyup and keypress, the value is visible and the user interaction is done, so getValue() should return the full shown value.
Thanks