diff --git a/lib/codemirror.js b/lib/codemirror.js
index 7be2fac1dbb1d4bfb55cd1c59191018769386d33..71010ddab2b0c79ed76d9ee247450654ce331684 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1221,7 +1221,7 @@
   };
 
   function hiddenTextarea() {
-    var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none");
+    var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none");
     var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
     // The textarea is kept positioned near the cursor to prevent the
     // fact that it'll be scrolled into view on input from scrolling