Search code examples
javascripthtmlgwtdom-events

How can I get the onChangeEvent _sooner_?


I'm using GWT to monitor changes to a TextArea. When the user types, I catch KeyPressEvents and update my logic accordingly.

However, when the user uses the mouse to change the value of the TextArea (e.g. cut & paste or drag) I do not get KeyPressEvents (of course). I still want to update immediately. I tried ChangeEvents, but it seems that they are only fired much later, when the TextArea loses focus.

I could listen for all ClickEvents, but is there a more logical mechanism that will alert my code right after the text in a textarea changes for any reason?


Solution

  • Seems like catching the paste & cut events directly is the best way - there's no "changed-at-all" event.