This bugged me today, and I couldn't find a solution for it.. so I'm just putting this out there..





You see what I want is for the text to be inserted into the textArea and have the scrollbar automatically scroll down to the bottom. By default it doesn't do that.. so I used the
vPosition = maxVPosition;
code and that scrolls the text all the way down, but the scrollbar doesn't quite go all the way down.. there's apparently a slight delay in the value of maxVPosition being changed (so if you press the setScrollPosition button you'll call the setScrollPosition again and see that the scrollbar correctly goes all the way to the bottom).

The hack I came up with was just to set an Interval for about 100ms and then set the position of the scrollbar again. Sigh.. I'm sure others have gone through this and found a better hack. Maybe there's a way to detect when the maxVPosition has finally been set? I think I remember coming across this issue with the scrollPane component as well.

oh..
function setScrollPosition() {
   with (myTextArea) {
      vPosition = maxVPosition;
   }
}