Elgg/Elgg — pull request #7020 by JoseLGM (2014-07-07 16:35:30+00:00)
Title: Update thewire.php for more effective textarea change detection

Now, with keydown and keyup remaining character indicator doesnt update when you paste text with the mouse.

"The input event takes care of IE9+, FF, Chrome, Opera and Safari, and onpropertychange takes care of IE8 (it also works with IE6 and 7, but there are some bugs).

The advantage of using input and onpropertychange is that they don't fire unnecessarily (like when pressing the Ctrl or Shift keys); so if you wish to run a relatively expensive operation when the textarea contents change, this is the way to go.

Now IE, as always, does a half-assed job of supporting this: neither input nor onpropertychange fires in IE when characters are deleted from the textarea. So if you need to handle deletion of characters in IE, use keypress (as opposed to using keyup / keydown, because they fire only once even if the user presses and holds a key down)."

Sources:
http://stackoverflow.com/questions/2823733/textarea-onchange-detection
http://www.alistapart.com/articles/expanding-text-areas-made-elegant/