title: Typing in autoresizing textarea keeps on focusing at the top of the element
body: <p>I have an expanding textarea. When the textarea has already expanded enough to reach the bottom of the window, the body flickers/scrolls back to the top of the textarea and you cannot see the last characters you've keyed in unless you scroll the window.</p>
  
  <p>The sample can be found in this <a href="http://jsfiddle.net/E9wZY/1/" rel="nofollow">jsfiddle</a>. I tried adding a scrollTo to the body</p>
  
  <pre><code>window.scrollTo(0, document.getElementsByTagName('textarea')[0].getBoundingClientRect().bottom);
  </code></pre>
  
  <p>How can I calculate the offset of the cursor in textarea from the window? I was thinking of getting the top offset of the cursor and just scrolling the window to its position if the cursor is already beyond the fold.</p>
  
  <p>Help on this would be greatly appreciated :)</p>